# Run one simples playbook with roles.

**URL:** <https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491>\
**Category:** Ansible Project\
**Created:** [March 17, 2020, 10:39pm UTC](https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491 "2020-03-17T22:39:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcelo\_Garcia\_Palma](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marcelo\_Garcia\_Palma](https://forum.ansible.com/u/Marcelo_Garcia_Palma)\
**Post date:** [March 17, 2020, 10:39pm UTC](https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491/1 "2020-03-17T22:39:55Z")

</div>

Hi guys!

I’m need someone help me.

I am new at world of ansible, then I create one sample for learning more, but I have a problem with roles.

I have two roles one myql and one webserver, I did the struture correctly, but when I exec the playbook it not exec the tasks at role webserver.

I can’t find the error.

See the output below.

O role for mysql it’s fine, but the role for webserver isn’t.

can someone me help?

PLAY [database] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/marcelo-palma/Documents/Marcelo/Alura/Devops/Ansible/java/provisioning.yml:2  
ok: [172.17.177.42]  
META: ran handlers

TASK [mysql : Instala pacotes de dependia do postgres] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/marcelo-palma/Documents/Marcelo/Alura/Devops/Ansible/java/roles/mysql/tasks/main.yml:2  
ok: [172.17.177.42] =\> (item=[u’postgresql’, u’python-psycopg2’, u’postgresql-contrib’, u’libpq-dev’, u’postgresql-client’]) =\> {“cache\_update\_time”: 1573150714, “cache\_updated”: false, “changed”: false, “item”: [“postgresql”, “python-psycopg2”, “postgresql-contrib”, “libpq-dev”, “postgresql-client”]}

TASK [mysql : Copy of configurations initial pg\_hba.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.42] =\> {“changed”: false, “checksum”: “8d44885d8deb51429a488cc44f9c00934b4cfac5”, “dest”: “/etc/postgresql/9.3/main/pg\_hba.conf”, “gid”: 116, “group”: “postgres”, “mode”: “0640”, “owner”: “postgres”, “path”: “/etc/postgresql/9.3/main/pg\_hba.conf”, “size”: 4648, “state”: “file”, “uid”: 109}

TASK [mysql : Copy of configurations initial postgresql.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.42] =\> {“changed”: false, “checksum”: “52d9262e58c6bd7b76b8127bd5b903e9becaf453”, “dest”: “/etc/postgresql/9.3/main/postgresql.conf”, “gid”: 116, “group”: “postgres”, “mode”: “0644”, “owner”: “postgres”, “path”: “/etc/postgresql/9.3/main/postgresql.conf”, “size”: 27010, “state”: “file”, “uid”: 109}

TASK [mysql : Ensure the PostgreSQL service is running] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.42] =\> {“changed”: false, “enabled”: true, “name”: “postgresql”, “state”: “started”}

TASK [mysql : Create database register-service] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.42] =\> {“changed”: false, “db”: “register-service”}

TASK [mysql : Add user fot database] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.42] =\> {“changed”: false, “user”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”}  
META: ran handlers  
META: ran handlers

PLAY [applications] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [172.17.177.40]  
META: ran handlers  
META: ran handlers  
META: ran handlers

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
172.17.177.40 : ok=1 changed=0 unreachable=0 failed=0  
172.17.177.42 : ok=7 changed=0 unreachable=0 failed=0

---

<div class="post-metadata">

**Author:** ![Marcelo\_Garcia\_Palma](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marcelo\_Garcia\_Palma](https://forum.ansible.com/u/Marcelo_Garcia_Palma)\
**Post date:** [March 17, 2020, 10:43pm UTC](https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491/2 "2020-03-17T22:43:29Z")

</div>

The project can by found here [https://github.com/marcelop3251/Ansible-with-Java](https://github.com/marcelop3251/Ansible-with-Java)

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [March 18, 2020, 11:59am UTC](https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491/3 "2020-03-18T11:59:20Z")

</div>

> Hi guys!
> 
> I'm need someone help me.
> 
> I am new at world of ansible, then I create one sample for learning more, but I have a problem with roles.
> 
> I have two roles one myql and one webserver, I did the struture correctly, but when I exec the playbook it not exec the  
> tasks at role webserver.
> 
> I can't find the error.

TOO\_MANY\_DOTS

roles/webserver/tasks/main..yml

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Marcelo\_Garcia\_Palma](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marcelo\_Garcia\_Palma](https://forum.ansible.com/u/Marcelo_Garcia_Palma)\
**Post date:** [March 18, 2020, 12:18pm UTC](https://forum.ansible.com/t/run-one-simples-playbook-with-roles/32491/4 "2020-03-18T12:18:29Z")

</div>

Thank you so much.
