Error:
Lab – Ansible Variables and Facts - 8
lab-ansible-variables-and-facts
Question: 8
/home/bob/playbooks/app_install.yaml
I got DEPRECATION WARNINGs and CHECK fails.
[bob@student-node playbooks]$ cat app_install.yaml
- hosts: all
become: yes
tasks:- name: Install applications
yum:
name: “{{ item }}”
state: present
with_items:- “{{ app_list }}”
- name: Install applications
[bob@student-node playbooks]$ ansible-playbook -i inventory app_install.yaml
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
ok: [node02]
ok: [node01]
TASK [Install applications] ****************************************************
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying name: "{{ item }}"
, please use name: ['{{ app_list }}']
and
remove the loop. This feature will be removed in version 2.11. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying name: "{{ item }}"
, please use name: ['{{ app_list }}']
and
remove the loop. This feature will be removed in version 2.11. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying name: "{{ item }}"
, please use name: ['{{ app_list }}']
and
remove the loop. This feature will be removed in version 2.11. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [localhost] => (item=[‘vim’, ‘sqlite’, ‘jq’])
changed: [node02] => (item=[‘vim’, ‘sqlite’, ‘jq’])
changed: [node01] => (item=[‘vim’, ‘sqlite’, ‘jq’])
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
node01 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
node02 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[bob@student-node playbooks]$
FAILS - Replaced the hardcoded list of packages in “app_install.yaml” playbook to use the values from the “app_list” variable defined in the inventory file?
OK - Run the playbook to make sure it works fine.
Comment:
Is this a good idea in a folder name: : “%e2%9c%a8” ?