Open alexppg opened 7 years ago
@alexppg
It's failing due to:
File "/_ansible/container/utils/__init__.py", line 113, in format_environment
return ['='.join(tpl) for tpl in iteritems(to_return)]
The environment syntax in your container.yml
is incorrect. Looks you stuck the role parameters under environment
. If you change your container.yml
to the following, it should work:
version: "2"
settings:
conductor:
base: ubuntu:16.04
project_name: php7-ubuntu
defaults:
services:
base:
from : ubuntu:16.04
command :
- /bin/bash
roles:
- geerlingguy.nginx
nginx_vhosts:
- listen: "80"
server_name: "example.com www.example.com"
return: "301 https://example.com$request_uri"
filename: "example.com.80.conf"
Oh, what a stupid error, my bad. But isn't it weird that it begins to build the image when there's a syntax error?
Also, the way you suggest doesn't work. I can't find any information on how to pass variables to the roles, is there any other way?
O. Sorry. It needs the object form of the role. So it should be the following:
roles:
- role: geerlingguy.nginx
nginx_vhosts:
- listen: "80"
server_name: "example.com www.example.com"
return: "301 https://example.com$request_uri"
filename: "example.com.80.conf"
Note that the name of the role is preceded by role:
Thank you very much, it works now. I think it would be useful to add an example of how to pass variables to the roles in the documentation.
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
The playbook is executed correctly but it fails when commiting the layer.
STEPS TO REPRODUCE
It will return:
EXPECTED RESULTS
It should create a new image, since the playbook finishes correctly.
ACTUAL RESULTS
It doesn't.