[Semibug] Ansible question

Mike Wayne semibug15 at wayne47.com
Wed Jan 18 00:36:46 EST 2017

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
   ansible-playbook -i ./hosts --become --ask-become-pass ./Playbooks/install_resolv_conf.yml
and here's the playbook copied using examples at

- hosts: jailservers
- 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.

More information about the Semibug mailing list