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