Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

updated minimum required ansible version to 2.5 in README, as the used 'loop' keyword was introduced in version 2.5 #19

Merged
merged 2 commits into from
Oct 11, 2018

Conversation

szEvEz
Copy link
Contributor

@szEvEz szEvEz commented Oct 10, 2018

Executing the role using the example playbook

- hosts: localhost
  roles:
    - dev-sec.nginx-hardening

with Ansible version > 2.5 (in my case 2.4.2) results to the following error:

[root@localhost ~]# ansible-playbook hardening.yaml
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

ERROR! The field 'loop' is supposed to be a string type, however the incoming data structure is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'>

The error appears to have been in '/etc/ansible/roles/dev-sec.nginx-hardening/tasks/main.yml': line 66, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: remove default.conf
  ^ here

After some research I stumbled upon the following solution - it looks like the loop keyword is new in version 2.5, therefor not working with lower versions.

Upgrading my Ansible version to >=2.5 solved this issue for me.

@szEvEz szEvEz changed the title updated minimum required ansible version to 2.5, as the used 'loop' keyword was introduced in version 2.5 updated minimum required ansible version to 2.5 in README, as the used 'loop' keyword was introduced in version 2.5 Oct 10, 2018
@rndmh3ro rndmh3ro merged commit 5ee4f59 into dev-sec:master Oct 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants