[Semibug] Ansible question

Michael W. Lucas mwlucas at michaelwlucas.com
Wed Jan 18 10:24:28 EST 2017


Could be spacing or indentation, definitely check at
http://www.yamllint.com/

Try -v

I wouldn't makefile this. Instead, expand your playbook. Not sure how
make interacts with ansible. Maybe it's fine, I dunno, but run by hand
and check.

Not sure what the relative path will do, try full path.

Other than that, looks right to me. I'd ask on Ansible forum.

==ml

On Wed, Jan 18, 2017 at 12:36:46AM -0500, Mike Wayne wrote:
> 
> Got Ansible installed. Can do the initial commands:
>    ansible all -m ping
>    ansible all -a "/bin/echo hello"
> 
> So I tried a playbook for the simplest thing I could think of, install a file.
> 
> I stuck this in a Makefile as I suspect there will, eventually, be a lot of
> commands:
>    ansible-playbook -i ./hosts --become --ask-become-pass ./Playbooks/install_resolv_conf.yml
> and here's the playbook copied using examples at
>    http://docs.ansible.com/ansible/copy_module.html
> 
> ---
> - hosts: jailservers
>   tasks:
> - name: Install /etc/resolv.conf and set permissions
> - copy:
>     src: ./Files/resolv.conf
>     dest: /etc/resolv.conf
>     owner: root
>     group: wheel
>     mode: "u=r,g=r,o=r"
> 
> But I keep getting an error:
> SUDO password: 			<I enter the password>
> ERROR! 'copy' is not a valid attribute for a Play
> 
> The error appears to have been in './Playbooks/install_resolv_conf.yml': line 5, column 3, but may
> be elsewhere in the file depending on the exact syntax problem.
> 
> - name: Install /etc/resolv.conf and set permissions
> - copy:
>   ^ here
> 
> Clearly I'm missing something simple but the docs all seem to assume you already
> know what you are doing.
> 
> _______________________________________________
> Semibug mailing list
> Semibug at lists.nycbug.org
> http://lists.nycbug.org/mailman/listinfo/semibug

-- 
Michael W. Lucas  -  mwlucas at michaelwlucas.com, Twitter @mwlauthor 
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/



More information about the Semibug mailing list