{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/236","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/236/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/236/events","html_url":"https://github.com/ansible/ansible-modules-extras/issues/236","id":56682188,"number":236,"title":"firewalld: will remove previos rules","user":{"login":"xrow","id":295491,"avatar_url":"https://avatars.githubusercontent.com/u/295491?v=3","gravatar_id":"","url":"https://api.github.com/users/xrow","html_url":"https://github.com/xrow","followers_url":"https://api.github.com/users/xrow/followers","following_url":"https://api.github.com/users/xrow/following{/other_user}","gists_url":"https://api.github.com/users/xrow/gists{/gist_id}","starred_url":"https://api.github.com/users/xrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xrow/subscriptions","organizations_url":"https://api.github.com/users/xrow/orgs","repos_url":"https://api.github.com/users/xrow/repos","events_url":"https://api.github.com/users/xrow/events{/privacy}","received_events_url":"https://api.github.com/users/xrow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/P2","name":"P2","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-05T15:11:18Z","updated_at":"2015-03-03T02:42:36Z","closed_at":null,"body":"firewalld will only have the latest rule applied to the settings.\r\n\r\nIf you run this Task:\r\n\r\n- name: Firewall settings\r\n  firewalld: zone=public port=8080/tcp permanent=true state=enabled\r\n  firewalld: zone=public port=8983/tcp permanent=true state=enabled\r\n  firewalld: zone=public port=443/tcp permanent=true state=enabled\r\n  firewalld: zone=public port=80/tcp permanent=true state=enabled\r\n- shell: firewall-cmd --reload\r\n\r\nYou get this result with misses ports.\r\n\r\n[root@localhost ~]# firewall-cmd --list-all\r\npublic (default)\r\n  interfaces: \r\n  sources: \r\n  services: dhcpv6-client ssh\r\n  ports: 443/tcp 80/tcp\r\n  masquerade: no\r\n  forward-ports: \r\n  icmp-blocks: \r\n  rich rules: \r\n\r\nThis is wrong, but as a workaround you can call firewalld from Shell and it works well.\r\n- name: Firewall settings\r\n  shell: firewall-cmd --permanent --zone=public --add-port=8080/tcp\r\n  shell: firewall-cmd --permanent --zone=public --add-port=8983/tcp\r\n  shell: firewall-cmd --permanent --zone=public --add-port=80/tcp\r\n  shell: firewall-cmd --permanent --zone=public --add-port=443/tcp\r\n  shell: firewall-cmd --reload\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/76876570","html_url":"https://github.com/ansible/ansible-modules-extras/issues/236#issuecomment-76876570","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/236","id":76876570,"user":{"login":"jrobeson","id":56908,"avatar_url":"https://avatars.githubusercontent.com/u/56908?v=3","gravatar_id":"","url":"https://api.github.com/users/jrobeson","html_url":"https://github.com/jrobeson","followers_url":"https://api.github.com/users/jrobeson/followers","following_url":"https://api.github.com/users/jrobeson/following{/other_user}","gists_url":"https://api.github.com/users/jrobeson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrobeson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrobeson/subscriptions","organizations_url":"https://api.github.com/users/jrobeson/orgs","repos_url":"https://api.github.com/users/jrobeson/repos","events_url":"https://api.github.com/users/jrobeson/events{/privacy}","received_events_url":"https://api.github.com/users/jrobeson/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T02:42:36Z","updated_at":"2015-03-03T02:42:36Z","body":"what i've been doing is this:\r\n\r\n  with_items:\r\n    - { service: 'postgresql', permanent: true }\r\n    - { service: 'postgresql', permanent: false }\r\n\r\nno need for a manual reload call. \r\n\r\nansible 1.9 will feature an option called immediate to apply the option immediately, but for now, this is the best way to use firewalld from ansible.\r\n"}}