Correcting tasks with new syntax for hostvars.
This commit is contained in:
parent
bbf6eb5a10
commit
95e48b21ab
@ -16,7 +16,7 @@
|
|||||||
purge: yes
|
purge: yes
|
||||||
with_items: "{{ base_client_delpkg }}"
|
with_items: "{{ base_client_delpkg }}"
|
||||||
become: yes
|
become: yes
|
||||||
when: role == 'client' and base_client_delpkg|length > 0
|
when: hostvars.hostname.role == 'client' and base_client_delpkg|length > 0
|
||||||
|
|
||||||
- name: Removing packages from docenti machines
|
- name: Removing packages from docenti machines
|
||||||
apt:
|
apt:
|
||||||
@ -25,7 +25,7 @@
|
|||||||
purge: yes
|
purge: yes
|
||||||
with_items: "{{ base_docenti_delpkg }}"
|
with_items: "{{ base_docenti_delpkg }}"
|
||||||
become: yes
|
become: yes
|
||||||
when: role == 'docenti' and base_docenti_delpkg|length > 0
|
when: hostvars.hostname.role == 'docenti' and base_docenti_delpkg|length > 0
|
||||||
|
|
||||||
- name: Cleanup of unneeded packages
|
- name: Cleanup of unneeded packages
|
||||||
shell: apt-get -y autoremove
|
shell: apt-get -y autoremove
|
||||||
@ -47,7 +47,7 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items: "{{ base_client_addpkg }}"
|
with_items: "{{ base_client_addpkg }}"
|
||||||
become: yes
|
become: yes
|
||||||
when: role == 'client' and base_client_addpkg|length > 0
|
when: hostvars.hostname.role == 'client' and base_client_addpkg|length > 0
|
||||||
|
|
||||||
- name: Installing additional packages for docenti role
|
- name: Installing additional packages for docenti role
|
||||||
apt:
|
apt:
|
||||||
@ -55,7 +55,7 @@
|
|||||||
state: present
|
state: present
|
||||||
with_items: "{{ base_docenti_addpkg }}"
|
with_items: "{{ base_docenti_addpkg }}"
|
||||||
become: yes
|
become: yes
|
||||||
when: role == 'docenti' and base_docenti_addpkg|length > 0
|
when: hostvars.hostname.role == 'docenti' and base_docenti_addpkg|length > 0
|
||||||
|
|
||||||
- name: Correggo NetworkManager per gestire la rete
|
- name: Correggo NetworkManager per gestire la rete
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
---
|
---
|
||||||
# Managing actions for role 'client'
|
# Managing actions for role 'client'
|
||||||
|
|
||||||
- debug: var=hostvars.localhost.role
|
|
||||||
|
|
||||||
- include: epoptes.yml
|
- include: epoptes.yml
|
||||||
when: "{{ role }} == 'client'"
|
when: hostvars.localhost.role == 'client'
|
||||||
tags:
|
tags:
|
||||||
- role
|
- role
|
||||||
- client
|
- client
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Managing actions for role 'docenti'
|
# Managing actions for role 'docenti'
|
||||||
|
|
||||||
- include: epoptes.yml
|
- include: epoptes.yml
|
||||||
when: "role == 'docenti'"
|
when: hostvars.localhost.role == 'docenti'
|
||||||
tags:
|
tags:
|
||||||
- role
|
- role
|
||||||
- docenti
|
- docenti
|
||||||
|
@ -10,16 +10,16 @@
|
|||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
become: yes
|
become: yes
|
||||||
with_items: "{{ addpkg }}"
|
with_items: "{{ hostvars.localhost.addpkg }}"
|
||||||
when: addpkg is defined and addpkg|join(' ')|trim != ''
|
when: hostvars.localhost.addpkg|join(' ')|trim != ''
|
||||||
|
|
||||||
- name: Removing packages for specific role from NetworkPackageManager
|
- name: Removing packages for specific role from NetworkPackageManager
|
||||||
apt:
|
apt:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
purge: yes
|
purge: yes
|
||||||
with_items: "{{ delpkg }}"
|
with_items: "{{ hostvars.localhost.delpkg }}"
|
||||||
when: delpkg is defined and delpkg|join(' ')|trim != ''
|
when: hostvars.localhost.delpkg|join(' ')|trim != ''
|
||||||
|
|
||||||
- name: Updating local hash for packages
|
- name: Updating local hash for packages
|
||||||
shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}'
|
shell: 'rm -f {{ ansible_local.checksum.pkgver_file }} && echo "{{ ansible_local.checksum.pkgver }}" > {{ ansible_local.checksum.pkgver_file }}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user