ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

ruamel.yaml should be lockdown better #958

Closed ms443 closed 6 years ago

ms443 commented 6 years ago

According to pypi ruamel.yaml should be 0.15 or less

For production systems you should pin the version being used with ruamel.yaml<=0.15

tzok commented 6 years ago

Ansible-container works with ruamel.yaml 0.15.51 and earlier, but 0.15.52 and later fail the container build. This is true even for the most basic configurations like ansible-container init creates.

Please mark this issue as a bug and pin the version of ruamel.yaml, because otherwise ansible-container is unusable for a typical user.

$ pip install ruamel.yaml==0.15.52
Collecting ruamel.yaml==0.15.52
  Using cached https://files.pythonhosted.org/packages/07/0f/c57e0f402f8f0b780d0cf3b5814489c30a531b7fdf21f9180a90320bc347/ruamel.yaml-0.15.52-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: ruamel.yaml
  Found existing installation: ruamel.yaml 0.15.51
    Uninstalling ruamel.yaml-0.15.51:
      Successfully uninstalled ruamel.yaml-0.15.51
Successfully installed ruamel.yaml-0.15.52

$ ansible-container build
ERROR   The container.yml file is invalid: ordereddict([('version', '2'), ('settings', ordereddict([('conductor', ordereddict([('base', 'ubuntu:xenial')])), ('project_name', 'rnative')])), ('services', ordereddict()), ('registries', ordereddict())]) is not of type 'object'   
(...)
TypeError: Object of type 'CommentedMap' is not JSON serializable
$ pip install ruamel.yaml==0.15.51
Collecting ruamel.yaml==0.15.51
  Using cached https://files.pythonhosted.org/packages/d2/7f/9bb3ba89ceab600c4a0ea75d638ea945215ca3458ac6528e0e39fa3254e4/ruamel.yaml-0.15.51-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: ruamel.yaml
  Found existing installation: ruamel.yaml 0.15.52
    Uninstalling ruamel.yaml-0.15.52:
      Successfully uninstalled ruamel.yaml-0.15.52
Successfully installed ruamel.yaml-0.15.51

$ ansible-container build
Building Docker Engine context...   
Starting Docker build of Ansible Container Conductor image (please be patient)...   
Parsing conductor CLI args.
Copying build context into Conductor container.
Dockerâ„¢ daemon integration engine loaded. Build starting.   project=rnative
All images successfully built.
Conductor terminated. Cleaning up.  command_rc=0 conductor_id=0d43ab3f25c047c04bf00474e69208f07c0f6d9f8e9a267302cc7e0b8f740da7 save_container=False
weisslj commented 6 years ago

This is caused by https://bitbucket.org/ruamel/yaml/commits/ace40a6a40270b75320971d1c9ff7625fbf6e081.