Hi
There were a couple of small yaml syntax errors in your playbook. Here is
what it should look like:
---
- 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 }}"
Now I was able to run this but it fails because I don't have any of the
vars defined and so it could still be possible there are more syntax issues
which I've not encountered yet.
Anyway, at least it will move you a little forwards in your adventure. :-)
Good luck
Regards,
Jinesh
On Sunday, 29 January 2017 05:14:56 UTC, Neal Z wrote:
>
> 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 }}
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d6b601d6-44c9-4c09-9aaf-1c3d3d1df52b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.