---
- name: fix masquerade
  hosts: undercloud
  become: yes
  any_errors_fatal: yes
  gather_facts: no
  tasks:
      - name: "w/a for bz#1460116"
        service:
            name: iptables
            state: restarted

- name: compute related workarounds
  hosts: compute
  become: yes
  any_errors_fatal: yes
  gather_facts: no
  tasks:
      - name: "w/a for 1477720"
        shell: |
           setenforce 0
        tags: skip_ansible_lint

      - name: w/a for https://bugs.launchpad.net/tripleo/+bug/1708279 - retrieve subnet
        shell: |
           docker network inspect bridge|jq ".[].IPAM.Config[].Subnet"
        register: docker_subnet
        tags: skip_ansible_lint

      - name: w/a for https://bugs.launchpad.net/tripleo/+bug/1708279 - add iptables rule
        shell: |
           iptables -t nat -I POSTROUTING -s "{{ docker_subnet.stdout }}" -j MASQUERADE
        tags: skip_ansible_lint

      - name: "w/a for bz 1464182"
        shell: |
          docker exec -u root -i nova_compute bash -c "echo $(hexdump -n 16 -v -e '/1 "%02x"' /dev/urandom) |tee /etc/machine-id"

---
- name: compute related workarounds
  hosts: compute
  become: yes
  any_errors_fatal: yes
  gather_facts: no
  tasks:
      - name: "w/a for 1477720"
        shell: |
           setenforce 0
        tags: skip_ansible_lint

      - name: w/a for https://bugs.launchpad.net/tripleo/+bug/1708279 - retrieve subnet
        shell: |
           docker network inspect bridge|jq ".[].IPAM.Config[].Subnet"
        register: docker_subnet
        tags: skip_ansible_lint

      - name: w/a for https://bugs.launchpad.net/tripleo/+bug/1708279 - add iptables rule
        shell: |
           iptables -t nat -I POSTROUTING -s "{{ docker_subnet.stdout }}" -j MASQUERADE
        tags: skip_ansible_lint

      - name: "w/a for bz 1464182"
        shell: |
          docker exec -u root -i nova_compute bash -c "echo $(hexdump -n 16 -v -e '/1 "%02x"' /dev/urandom) |tee /etc/machine-id"

Stop (re)starting iptables on the undercloud
Stop (re)starting iptables on the undercloud

we are assunming the iptables is `running`,
and we do not need to retsart it.

Related bug: rhbz#1460116

Change-Id: I8f7c9201fededf14c2c1ee96516233a1a8fcabc9
