main.yml 627 B

123456789101112131415161718
  1. ---
  2. # Adds sso.lab.example.com and idm.lab.example.com as aliases for workstation to /etc/hosts
  3. # Must be executed on bastion.lab.example.com
  4. #
  5. # Basically there is a line with workstation IP there...
  6. #
  7. # 172.25.250.9 workstation.lab.example.com workstation
  8. #
  9. # And it must have the above hostnames added, theen dnsmasq restarted.
  10. - name: Make sure hostnames are in /etc/hosts
  11. ansible.builtin.lineinfile:
  12. path: /etc/hosts
  13. regexp: '^172.25.250.9\s+'
  14. line: "172.25.250.9 workstation.lab.example.com workstation sso.lab.example.com idm.lab.example.com"
  15. state: present
  16. notify:
  17. - Restart dnsmasq
  18. ...