# My frist Playbooks - Please Comment

**URL:** <https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588>\
**Category:** Ansible Project\
**Created:** [October 1, 2013, 2:17pm UTC](https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588 "2013-10-01T14:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcelo\_Costa](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@Marcelo\_Costa](https://forum.ansible.com/u/Marcelo_Costa)\
**Post date:** [October 1, 2013, 2:17pm UTC](https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588/1 "2013-10-01T14:17:37Z")

</div>

Hi, folks

I create my first playbook and I’d like, if possible, comments.

[https://github.com/marcelojscosta/ansible-example-playbooks/blob/master/bootnode.yml](https://github.com/marcelojscosta/ansible-example-playbooks/blob/master/bootnode.yml)

I had doubts in the use of rsync and when I change the owner of a directory and also for copying flat files to specific directories like .bashrc, 10-fastcgi.conf and lighttpd.conf.

In fact, I first create the directory, then I copy the data recursively with rsync and then change the owner of the directory that was created. (user: www-data group: www-data)

Did can I do these tasks with fewer lines?

My approach is correct?

Thanks,

Marcelo Costa

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 1, 2013, 2:26pm UTC](https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588/2 "2013-10-01T14:26:09Z")

</div>

A few small things:

" action: command mkdir -p //sites creates=//sites"

can be replaced with:

file: path=/path state=directory

You should not be using $old variables and should be using {{ new }} variables

Configuration files should probably be laid down with the template module.

You should probably look into using roles at some point later, just because they are nice, but it’s not required.

I believe update\_cache=yes can be passed on the same line with the apt module to install the package. There’s a cache timeout. (See docs)
