Conditional loop lab


My Playbook -

  • hosts: web2
    gather_facts: no
    remote_dest: /usr/local/bin/
    • command: sh “{{ remote_dest }}”
      register: test
    • yum: name=bash state=latest

Can someone help me with this when condition what needs to be?

  • name: play1 shell shock play
    hosts: web2
    gather_facts: no
    - name: check shell shock
    shell: ‘/usr/local/bin/’
    register: test

  • name: update bash based on play1
    hosts: web2
    gather_facts: no
    - name: update bash if vulnerable
    yum: name=bash state=latest
    when: “test.stdout.find(‘vulnerable’) == -1”

please indent accordingly.

@domingochavez16 use pre keyword in between <> and closed with same keyword </> (like /pre) or you can use ``` triple this exactly i don’t know name and in the end use same triple this.

The validation for Q7 seems to be broken, and the sample answer is incorrect/incomplete.

- hosts: web2
  gather_facts: no
    - name: Run a script
      shell: sh /usr/local/bin/
      register: test
    - debug:
        var: test

Trying to run any playbook gives the following output:

└── ansible-0510-conditionals
    └── cleanup
--> Scenario: 'ansible-0510-conditionals'
--> Action: 'cleanup'
ERROR! playbooks must be a list of plays