Run one simples playbook with roles.

19 views
Skip to first unread message

Marcelo Garcia Palma

unread,
Mar 17, 2020, 6:39:55 PM3/17/20
to Ansible Project
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   

Marcelo Garcia Palma

unread,
Mar 17, 2020, 6:43:29 PM3/17/20
to Ansible Project

Stefan Hornburg (Racke)

unread,
Mar 18, 2020, 8:00:01 AM3/18/20
to ansible...@googlegroups.com
On 3/17/20 11:39 PM, Marcelo Garcia Palma wrote:
> 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
Racke
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d002d73c-3431-49d1-a734-f4ee8357b544%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d002d73c-3431-49d1-a734-f4ee8357b544%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

Marcelo Garcia Palma

unread,
Mar 18, 2020, 8:18:30 AM3/18/20
to Ansible Project
Reply all
Reply to author
Forward
0 new messages