DigitalState/Platform

Ansible-playbook ./install.yml error (Dev env)

Closed this issue ยท 11 comments

I was following this
https://github.com/DigitalState/Platform/blob/0.11.0/platform/documentation/environments/dev/index.md
and I got this error when running ansible-playbook install.yml

`/etc/ansible/env/dev # ansible-playbook ./install.yml
[WARNING] Ansible is being run in a world writable directory (/etc/ansible/env/dev), ignoring it as an ansible.cfg source. For more information see https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: provided hosts list is empty, only localhost is available. Note
that the implicit localhost does not match 'all'

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/etc/ansible/playbook/app/repository/download.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:
- name: Compile files
^ here
`

Please tell me how to fix this.

It's an issue we've seen recently. Depending on how the ansible volume is shared from your host machine to the platform container, it may cause ansible to ignore it due to security measures on ansible's side.

What is the OS of your host machine? What is the output of cd /etc/ansible/env && ls -la while you're in the platform container?

`/etc/ansible/env/dev # cd /etc/ansible/env && ls -la

total 8
drwxrwxrwx 1 root root 0 Sep 6 04:21 .
drwxrwxrwx 1 root root 0 Sep 6 04:21 ..
drwxrwxrwx 1 root root 0 Sep 6 04:21 ci
drwxrwxrwx 1 root root 4096 Sep 6 04:21 dev
drwxrwxrwx 1 root root 4096 Sep 6 04:21 lab
drwxrwxrwx 1 root root 0 Sep 6 04:21 prod
drwxrwxrwx 1 root root 0 Sep 6 04:21 stag
/etc/ansible/env #
`

I am running CentOS 7 64bit

Seems like the volumes have permissions 777 inside the container. Ansible recognizes this as a security risk and ignores the folder containing the ansible.cfg file.

Are you able to configure your Docker so that volumes aren't 777 by default?

I can finally change the permissions and successfully installed the playbook.
Can I confirm that
admin.dev.ds
portal.dev.ds
are no longer suported ?

I got 404 accessing those pages.

They are supported, just out of date for the time being compared to the APIs. We have introduced Traefik, Consul and Tenants API microservice, which broke backward-compatibility with the UI.

If you want to use the UI, you can reinstall using the 0.6 tag

so now I rebooted my CentOS virtualbox and ran ansible-playbook ./install.yml again to get all the containers up. I was stopped at this error

fatal: [app]: FAILED! => {"changed": true, "cmd": "docker-compose exec -T php php bin/console doctrine:fixtures:load --env=dev --fixtures=/srv/api-platform/src/AppBundle/Fixtures --no-interaction", "delta": "0:00:01.123553", "end": "2018-09-28 17:04:55.669175", "msg": "non-zero return code", "rc": 255, "start": "2018-09-28 17:04:54.545622", "stderr": "\n \n [GuzzleHttp\Exception\ServerException] \n Server error: POST api.formio.dev.ds/user/login resulted in a 502 Bad Ga \n teway response: \n Bad Gateway \n \n\ndoctrine:fixtures:load [--fixtures [FIXTURES]] [--append] [--em EM] [--shard SHARD] [--purge-with-truncate] [--multiple-transactions] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] ", "stderr_lines": ["", " ", " [GuzzleHttp\Exception\ServerException] ", " Server error: POST api.formio.dev.ds/user/login resulted in a 502 Bad Ga ", " teway response: ", " Bad Gateway ", " ", "", "doctrine:fixtures:load [--fixtures [FIXTURES]] [--append] [--em EM] [--shard SHARD] [--purge-with-truncate] [--multiple-transactions] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] "], "stdout": " > purging database\n > loading [0] AppBundle\Fixtures\System\Tenants\n > loading [0] AppBundle\Fixtures\System\Parameters\n > loading [10] AppBundle\Fixtures\Accesses\n > loading [10] AppBundle\Fixtures\Configs\n > loading [10] AppBundle\Fixtures\Metadatas\n > loading [11] AppBundle\Fixtures\Permissions\n > loading [20] AppBundle\Fixtures\Forms", "stdout_lines": [" > purging database", " > loading [0] AppBundle\Fixtures\System\Tenants", " > loading [0] AppBundle\Fixtures\System\Parameters", " > loading [10] AppBundle\Fixtures\Accesses", " > loading [10] AppBundle\Fixtures\Configs", " > loading [10] AppBundle\Fixtures\Metadatas", " > loading [11] AppBundle\Fixtures\Permissions", " > loading [20] AppBundle\Fixtures\Forms"]}


how come it no longer works ?
What do I do to get the dev up after system reboot?

What OS are you using on your host machine? Feels like formio's mongoDB is not working. HyperV is required if you are on windows for mongo to work in a virtualized setup.

Also, if you want to re-up the containers, simply run ansible-playbook app/container/up.yml. Re-running the entire install may have undesired results, such as resetting the databases, etc.

Thanks, this should go somewhere in the Documentation.

I agree, we've started a tutorials area in the platform documentation for how-to's https://github.com/DigitalState/Platform/blob/develop/platform/documentation/index.md#tutorials