diff --git a/adhoc-deploy-kvm-guest.yml b/adhoc-deploy-kvm-guest.yml index 92bbce2..dfd682a 100644 --- a/adhoc-deploy-kvm-guest.yml +++ b/adhoc-deploy-kvm-guest.yml @@ -1,7 +1,12 @@ --- -- hosts: kvm-guests +- hosts: "{{ init_kvm_guests }}" become: true gather_facts: false + vars_prompt: + - name: "init_kvm_guests" + prompt: "[WARNING] KVM guests to be deployed with CentOS => " + private: no + tasks: - name: Checking Virtual Guest exists virt: diff --git a/requirements-dev.yml b/requirements-dev.yml index 8804a9d..2993cad 100644 --- a/requirements-dev.yml +++ b/requirements-dev.yml @@ -20,6 +20,9 @@ - src: https://github.com/CentOS/ansible-role-certbot name: certbot version: staging +- src: https://github.com/CentOS/ansible-role-distgit-lookaside + name: distgit-lookaside + version: staging - src: https://github.com/CentOS/ansible-role-geoip2 name: geoip2 version: staging diff --git a/requirements-production.yml b/requirements-production.yml index fa0ce6a..4c70c43 100644 --- a/requirements-production.yml +++ b/requirements-production.yml @@ -13,6 +13,8 @@ name: centos-backup - src: https://github.com/CentOS/ansible-role-certbot name: certbot +- src: https://github.com/CentOS/ansible-role-distgit-lookaside + name: distgit-lookaside - src: https://github.com/CentOS/ansible-role-geoip2 name: geoip2 - src: https://github.com/CentOS/ansible-role-gitea diff --git a/requirements-staging.yml b/requirements-staging.yml index 8804a9d..2993cad 100644 --- a/requirements-staging.yml +++ b/requirements-staging.yml @@ -20,6 +20,9 @@ - src: https://github.com/CentOS/ansible-role-certbot name: certbot version: staging +- src: https://github.com/CentOS/ansible-role-distgit-lookaside + name: distgit-lookaside + version: staging - src: https://github.com/CentOS/ansible-role-geoip2 name: geoip2 version: staging diff --git a/role-all.yml b/role-all.yml index d1ecef5..d9c527b 100644 --- a/role-all.yml +++ b/role-all.yml @@ -5,6 +5,7 @@ - import_playbook: role-centbot.yml - import_playbook: role-centos-backup.yml - import_playbook: role-certbot.yml +- import_playbook: role-distgit-lookaside.yml - import_playbook: role-geoip2.yml - import_playbook: role-gitea.yml - import_playbook: role-haproxy.yml diff --git a/role-distgit-lookaside.yml b/role-distgit-lookaside.yml new file mode 100644 index 0000000..fd4d7e7 --- /dev/null +++ b/role-distgit-lookaside.yml @@ -0,0 +1,24 @@ +--- +- hosts: hostgroup-role-distgit-lookaside + become: True + pre_tasks: + - name: Checking if no-ansible file is there + stat: + path: /etc/no-ansible + register: no_ansible + + - name: Verifying if we can run ansible or not + assert: + that: + - "not no_ansible.stat.exists" + msg: "/etc/no-ansible file exists so skipping ansible run on this node" + + roles: + - distgit-lookaside + + post_tasks: + - name: Touching ansible-run (monitored by Zabbix) + file: + path: /var/log/ansible.run + state: touch + diff --git a/role-odcs-backend.yml b/role-odcs-backend.yml index 20378a4..11cd74d 100644 --- a/role-odcs-backend.yml +++ b/role-odcs-backend.yml @@ -1,6 +1,5 @@ --- -- name: Setup ODCS backend - hosts: hostgroup-role-odcs-backend +- hosts: hostgroup-role-odcs-backend become: True pre_tasks: - name: Checking if no-ansible file is there @@ -22,3 +21,4 @@ file: path: /var/log/ansible.run state: touch + diff --git a/role-odcs-frontend.yml b/role-odcs-frontend.yml index 422c148..bb69dff 100644 --- a/role-odcs-frontend.yml +++ b/role-odcs-frontend.yml @@ -1,6 +1,5 @@ --- -- name: Setup ODCS frontend - hosts: hostgroup-role-odcs-frontend +- hosts: hostgroup-role-odcs-frontend become: True pre_tasks: - name: Checking if no-ansible file is there @@ -22,3 +21,4 @@ file: path: /var/log/ansible.run state: touch + diff --git a/templates/kickstarts/kvm-guest-c8-ks.j2 b/templates/kickstarts/kvm-guest-c8-ks.j2 index dd690c6..adde800 100644 --- a/templates/kickstarts/kvm-guest-c8-ks.j2 +++ b/templates/kickstarts/kvm-guest-c8-ks.j2 @@ -5,7 +5,7 @@ auth --enableshadow --passalgo=sha512 # Use network installation -url --url="http://mirror.centos.org/centos/8/BaseOS/{{ kvm_guest_arch }}/os/" +url --url="http://mirror.centos.org/centos/{{ kvm_guest_distro_release }}/BaseOS/{{ kvm_guest_arch }}/os/" # Run the Setup Agent on first boot firstboot --enable #ignoredisk --only-use=sda diff --git a/templates/kickstarts/kvm-guest-c8-stream-ks.j2 b/templates/kickstarts/kvm-guest-c8-stream-ks.j2 new file mode 120000 index 0000000..9cbaf2d --- /dev/null +++ b/templates/kickstarts/kvm-guest-c8-stream-ks.j2 @@ -0,0 +1 @@ +kvm-guest-c8-ks.j2 \ No newline at end of file