I am a new user of Ansible.
I am trying to use the IOS_Config module and a I cannot find the syntax error in my playbook (See Below). I suspect I may be missing the IOS_Config module? I am on Mac running 2.2. But I am unsure if I have the developer modules or not.
Have confirmed no invisible characters in the file.
I am getting this error:
MacBook-Pro:ansible nealzipper$ ansible-playbook -i inventory backup-configs.yml -vvv
Using /etc/ansible/ansible.cfg as config file
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/Users/neal/ansible/backup-configs.yml': line 20, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: SAVE AND BACKUP CONFIGS
^ here
MacBook-Pro:ansible neal$ Here my playbook :
---
- name: PLAY - BACKUP
hosts: all
gather_facts: no
connection: local
tasks:
- name: OBTAIN LOGIN CREDENTIALS
include_vars: ./secrets.yml
- name: DEFINE PROVIDER
set_fact:
provider:
host: "{{ inventory_hostname }}"
username: "{{ creds['username'] }}"
password: "{{ creds['password'] }}"
auth_pass: "{{ creds['auth_pass'] }}"
- name: SAVE AND BACKUP CONFIGS
ios_config:
backup: yes
local_file: {{ filename }}
platform: {{ net_platform }}---- name: PLAY - BACKUP hosts: - localhost gather_facts: no connection: local
tasks: - name: OBTAIN LOGIN CREDENTIALS include_vars: ./secrets.yml
- name: DEFINE PROVIDER set_fact: provider: host: "{{ inventory_hostname }}" username: "{{ creds['username'] }}" password: "{{ creds['password'] }}" auth_pass: "{{ creds['auth_pass'] }}"
- name: SAVE AND BACKUP CONFIGS ios_config: backup: yes local_file: "{{ filename }}" platform: "{{ net_platform }}"