From 7cb80162a9bb3b46182a01bd6d3b5971f4eb1adb Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Thu, 3 Oct 2024 21:54:52 -0400 Subject: [PATCH] open up ports for foreman --- playbooks/{ => foreman}/install_foreman.yml | 0 playbooks/foreman/open_ports_reset_user.yml | 29 +++++++++++++++++++++ 2 files changed, 29 insertions(+) rename playbooks/{ => foreman}/install_foreman.yml (100%) create mode 100644 playbooks/foreman/open_ports_reset_user.yml diff --git a/playbooks/install_foreman.yml b/playbooks/foreman/install_foreman.yml similarity index 100% rename from playbooks/install_foreman.yml rename to playbooks/foreman/install_foreman.yml diff --git a/playbooks/foreman/open_ports_reset_user.yml b/playbooks/foreman/open_ports_reset_user.yml new file mode 100644 index 0000000..9917e92 --- /dev/null +++ b/playbooks/foreman/open_ports_reset_user.yml @@ -0,0 +1,29 @@ +--- +- name: Open all ports and needed by foreman + hosts: foremanAlma + become: yes + vars_files: + - /home/mango/projects/homelab/vars/secrets.yml + vars: + username: root + tasks: + - name: permit traffic in default zone for https service + ansible.posix.firewalld: + service: "{{item}}" + permanent: true + state: enabled + immediate: yes + loop: + - https + - dns + - dhcp + - tftp + - http + - "vnc-server" + - "postgresql" + - "puppetmaster" + + + - name: set admin user and password + ansible.builtin.command: + cmd: "foreman-rake permissions:reset username={{username}} password={{become_password}}"