i want flush iptable from Host after creation of VM using heat temlplate

asked 2014-10-29 02:40:20 -0500

harishamrale gravatar image

i want flush iptable from Host (Not form inside VM) after creation of VM using heat temlplate. Is there any way to do it.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-29 07:56:42 -0500

fgorbat gravatar image

Yes, the best way to do it, using the user_data section of the server definition. Here is basic example how to do it:

resources:
  server:
    type: OS::Nova::Server
    properties:
      key_name: { get_param: key_name }
      image: { get_param: image }
      flavor: { get_param: flavor }
      admin_pass: { get_param: admin_pass }
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            iptables --flush  # flush all the previous rules
            service iptables save  # save new configuration
            service iptables restart # restart the iptables service
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-10-29 02:40:20 -0500

Seen: 176 times

Last updated: Oct 29 '14