Skip to content
Extraits de code Groupes Projets
Valider 8518b767 rédigé par Théo - Le Filament's avatar Théo - Le Filament
Parcourir les fichiers

fix: collect package facts only for servers in maintenance

parent c870aa69
Aucune branche associée trouvée
Étiquettes v1.1.13
Aucune requête de fusion associée trouvée
...@@ -319,13 +319,14 @@ ...@@ -319,13 +319,14 @@
changed_when: false changed_when: false
register: known_hosts_line register: known_hosts_line
with_items: "{{ groups.backup_server }}" with_items: "{{ groups.backup_server }}"
when: inventory_hostname in groups.maintenance_contract
- name: Add backup servers in root known host - name: Add backup servers in root known host
ansible.builtin.known_hosts: ansible.builtin.known_hosts:
hash_host: true hash_host: true
key: "{{ hostvars[item['item']].host_server_known_entry }}" key: "{{ hostvars[item['item']].host_server_known_entry }}"
name: "[{{ hostvars[item['item']].ansible_host }}]:{{ default_sshd_port }}" name: "[{{ hostvars[item['item']].ansible_host }}]:{{ default_sshd_port }}"
when: item.found is not defined when: inventory_hostname in groups.maintenance_contract and item.found is not defined
with_items: "{{ known_hosts_line.results }}" with_items: "{{ known_hosts_line.results }}"
- name: Copy Installed Package Listing script on server - name: Copy Installed Package Listing script on server
...@@ -335,6 +336,7 @@ ...@@ -335,6 +336,7 @@
owner: root owner: root
group: root group: root
mode: '0700' mode: '0700'
when: inventory_hostname in groups.maintenance_contract
- name: Disable e-mailing of crontab - name: Disable e-mailing of crontab
ansible.builtin.cron: ansible.builtin.cron:
...@@ -348,3 +350,4 @@ ...@@ -348,3 +350,4 @@
minute: "43" minute: "43"
hour: "0" hour: "0"
job: /root/collect_installed_packages_facts.sh job: /root/collect_installed_packages_facts.sh
when: inventory_hostname in groups.maintenance_contract
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter