{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-container/issues/264","repository_url":"https://api.github.com/repos/ansible/ansible-container","labels_url":"https://api.github.com/repos/ansible/ansible-container/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-container/issues/264/comments","events_url":"https://api.github.com/repos/ansible/ansible-container/issues/264/events","html_url":"https://github.com/ansible/ansible-container/issues/264","id":180056895,"number":264,"title":"install python when copy fails with \"module failure\"","user":{"login":"MaxiReglisse","id":11272821,"avatar_url":"https://avatars.githubusercontent.com/u/11272821?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxiReglisse","html_url":"https://github.com/MaxiReglisse","followers_url":"https://api.github.com/users/MaxiReglisse/followers","following_url":"https://api.github.com/users/MaxiReglisse/following{/other_user}","gists_url":"https://api.github.com/users/MaxiReglisse/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxiReglisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxiReglisse/subscriptions","organizations_url":"https://api.github.com/users/MaxiReglisse/orgs","repos_url":"https://api.github.com/users/MaxiReglisse/repos","events_url":"https://api.github.com/users/MaxiReglisse/events{/privacy}","received_events_url":"https://api.github.com/users/MaxiReglisse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-29T13:58:25Z","updated_at":"2016-09-30T13:51:36Z","closed_at":"2016-09-29T20:14:59Z","body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\nsame problem as \"Copy module failure in 2.20 #15721\", but i found a different work around : i install python in the container, but i need to do that only one time, because everything falls into place after this first and unique installation.\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one item below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### container.yml \r\n```\r\nversion: \"1\"\r\nservices:\r\n  ldap:\r\n    image: dinkel/openldap\r\n    entrypoint: /docker-entrypoint.sh\r\n    command: [ \"slapd\", \"-d\", \"32768\", \"-u\", \"openldap\", \"-g\", \"openldap\" ]\r\n    environment:\r\n      - SLAPD_PASSWORD=secret\r\n      - SLAPD_DOMAIN=georchestra.org\r\n      - SLAPD_ADDITIONAL_MODULES=groupofmembers\r\n\r\nregistries: {}\r\n```\r\n\r\n##### main.yml \r\n```\r\n- hosts: ldap\r\n  gather_facts: no\r\n  vars:\r\n  tasks:\r\n    - name: Update all packages \r\n      raw: apt-get update\r\n    - name: Install ldap-utils\r\n      raw: apt-get install -y ldap-utils\r\n#    - name: Install python \r\n#      raw: apt-get install -y python python-apt\r\n    - name: Copy groupofmembers.ldif\r\n      copy: src=../groupofmembers.ldif dest=/etc/ldap.dist/modules owner=root group=root mode=0775\r\n    - name: Copy member.ldif\r\n      copy: src=../memberof.ldif dest=/tmp owner=openldap group=openldap mode=0775\r\n    - name: Copy georchestra.ldif\r\n      copy: src=../georchestra.ldif dest=/tmp owner=openldap group=openldap mode=0775\r\n    - name: Copy groupofmembers.ldif\r\n      copy: src=../groupofmembers.ldif dest=/etc/ldap.dist/modules/ owner=openldap group=openldap mode=0775\r\n    - name: Create docker-entrypoint.d directory\r\n      file: path=/docker-entrypoint.d state=directory owner=root group=root mode=0755\r\n    #- name: Copy docker-entrypoint.d/*\r\n    #  copy: src=../docker/docker-entrypoint.d/* dest=/docker-entrypoint.d/ owner=root group=root mode=0775\r\n    # ne fonctionne pas. on copie le fichier.\r\n    - name: Copy 00-populate\r\n      copy: src=../docker/docker-entrypoint.d/00-populate dest=/docker-entrypoint.d/ owner=root group=root mode=0775\r\n    - name: Copy docker-entrypoint.sh\r\n      copy: src=../docker/docker-entrypoint.sh dest=/ owner=root group=root mode=0775\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Paste output from `ansible-container --debug version` between the quotes below -->\r\n```\r\nAnsible Container, version 0.2.0-pre\r\nLinux, service-info12, 4.4.0-38-generic, #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016, x86_64\r\n2.7.12 (default, Jul  1 2016, 15:12:24) \r\n[GCC 5.4.0 20160609] /usr/bin/python\r\nNo DOCKER_HOST environment variable found. Assuming UNIX socket at /var/run/docker.sock\r\n{u'Architecture': u'x86_64',\r\n u'BridgeNfIp6tables': True,\r\n u'BridgeNfIptables': True,\r\n u'CPUSet': True,\r\n u'CPUShares': True,\r\n u'CgroupDriver': u'cgroupfs',\r\n u'ClusterAdvertise': u'',\r\n u'ClusterStore': u'',\r\n u'Containers': 0,\r\n u'ContainersPaused': 0,\r\n u'ContainersRunning': 0,\r\n u'ContainersStopped': 0,\r\n u'CpuCfsPeriod': True,\r\n u'CpuCfsQuota': True,\r\n u'Debug': False,\r\n u'DefaultRuntime': u'runc',\r\n u'DockerRootDir': u'/var/lib/docker',\r\n u'Driver': u'aufs',\r\n u'DriverStatus': [[u'Root Dir', u'/var/lib/docker/aufs'],\r\n                   [u'Backing Filesystem', u'extfs'],\r\n                   [u'Dirs', u'16'],\r\n                   [u'Dirperm1 Supported', u'true']],\r\n u'ExecutionDriver': u'',\r\n u'ExperimentalBuild': False,\r\n u'HttpProxy': u'',\r\n u'HttpsProxy': u'',\r\n u'ID': u'BHTK:32FH:RA6Z:TGCE:S3FJ:KRDY:IP3Y:NWMH:5V3N:B3X5:H23M:WG2A',\r\n u'IPv4Forwarding': True,\r\n u'Images': 4,\r\n u'IndexServerAddress': u'https://index.docker.io/v1/',\r\n u'KernelMemory': True,\r\n u'KernelVersion': u'4.4.0-38-generic',\r\n u'Labels': None,\r\n u'LiveRestoreEnabled': False,\r\n u'LoggingDriver': u'json-file',\r\n u'MemTotal': 33679785984,\r\n u'MemoryLimit': True,\r\n u'NCPU': 8,\r\n u'NEventsListener': 2,\r\n u'NFd': 41,\r\n u'NGoroutines': 55,\r\n u'Name': u'service-info12',\r\n u'NoProxy': u'',\r\n u'OSType': u'linux',\r\n u'OomKillDisable': True,\r\n u'OperatingSystem': u'Ubuntu 16.04.1 LTS',\r\n u'Plugins': {u'Authorization': None,\r\n              u'Network': [u'host', u'overlay', u'null', u'bridge'],\r\n              u'Volume': [u'local']},\r\n u'RegistryConfig': {u'IndexConfigs': {u'docker.io': {u'Mirrors': None,\r\n                                                      u'Name': u'docker.io',\r\n                                                      u'Official': True,\r\n                                                      u'Secure': True}},\r\n                     u'InsecureRegistryCIDRs': [u'127.0.0.0/8'],\r\n                     u'Mirrors': None},\r\n u'Runtimes': {u'runc': {u'path': u'docker-runc'}},\r\n u'SecurityOptions': [u'apparmor', u'seccomp'],\r\n u'ServerVersion': u'1.12.1',\r\n u'SwapLimit': False,\r\n u'Swarm': {u'Cluster': {u'CreatedAt': u'0001-01-01T00:00:00Z',\r\n                         u'ID': u'',\r\n                         u'Spec': {u'CAConfig': {},\r\n                                   u'Dispatcher': {},\r\n                                   u'Orchestration': {},\r\n                                   u'Raft': {},\r\n                                   u'TaskDefaults': {}},\r\n                         u'UpdatedAt': u'0001-01-01T00:00:00Z',\r\n                         u'Version': {}},\r\n            u'ControlAvailable': False,\r\n            u'Error': u'',\r\n            u'LocalNodeState': u'inactive',\r\n            u'Managers': 0,\r\n            u'NodeAddr': u'',\r\n            u'NodeID': u'',\r\n            u'Nodes': 0,\r\n            u'RemoteManagers': None},\r\n u'SystemStatus': None,\r\n u'SystemTime': u'2016-09-29T15:08:14.554075479+02:00'}\r\n{u'ApiVersion': u'1.24',\r\n u'Arch': u'amd64',\r\n u'BuildTime': u'2016-08-18T05:33:38.359262265+00:00',\r\n u'GitCommit': u'23cf638',\r\n u'GoVersion': u'go1.6.3',\r\n u'KernelVersion': u'4.4.0-38-generic',\r\n u'Os': u'linux',\r\n u'Version': u'1.12.1'}\r\n```\r\n##### SUMMARY\r\nit is necessary to install python in the container, just one time, when you want to build an image in which i need to copy a file.\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n##### Fisrt build\r\n\r\nansible-container will fail when it will try to copy a file.\r\nmy docker environment has been cleaned : no container, no image, no volume.\r\nand lines concerning python are commented : \r\n```\r\n#    - name: Install python \r\n#      raw: apt-get install -y python python-apt\r\n```\r\n```\r\n$ ansible-container build\r\nNo DOCKER_HOST environment variable found. Assuming UNIX socket at /var/run/docker.sock\r\nStarting Docker Compose engine to build your images...\r\n0.2: Pulling from ansible/ansible-container-builder\r\n8d30e94188e7: Pull complete\r\n24cbd75f8b32: Pull complete\r\nd6ee161b4be5: Pull complete\r\na4b49951d8df: Pull complete\r\n853ec44630ce: Pull complete\r\nb7e98f774514: Pull complete\r\nd787669f451c: Pull complete\r\n250fdf0b77c5: Pull complete\r\n33400106458e: Pull complete\r\nDigest: sha256:ecbf2feee8cfa0b4167ca1bb74bfff62f61c3e7009b048f239da13db3806bc6b\r\nStatus: Downloaded newer image for ansible/ansible-container-builder:0.2\r\nAttaching to ansible_ansible-container_1\r\nCleaning up Ansible Container builder...\r\nNo image found for tag geosync-ldap:latest, so building from scratch\r\nlatest: Pulling from dinkel/openldap\r\n6a5a5368e0c2: Pull complete\r\n972589a83202: Pull complete\r\nd13470039f58: Pull complete\r\n12de2abf2c7a: Pull complete\r\n07f52b3e71ee: Pull complete\r\nDigest: sha256:4b59b367643c101f2fc854ca18896402ea263e533105a703884bfaeee5e57c77\r\nStatus: Downloaded newer image for dinkel/openldap:latest\r\nAttaching to ansible_ldap_1, ansible_ansible-container_1\r\nansible-container_1  | Host ldap running\r\nansible-container_1  | \r\nansible-container_1  | PLAY [ldap] ********************************************************************\r\nansible-container_1  | \r\nansible-container_1  | TASK [Update all packages] *****************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Install ldap-utils] ******************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy groupofmembers.ldif] ************************************************\r\nansible-container_1  | fatal: [ldap]: FAILED! => {\"failed\": true, \"msg\": \"Failed to get information on remote file (/etc/ldap.dist/modules): MODULE FAILURE\"}\r\nansible-container_1  | \r\nansible-container_1  | NO MORE HOSTS LEFT *************************************************************\r\nansible-container_1  | \r\nansible-container_1  | PLAY RECAP *********************************************************************\r\nansible-container_1  | ldap                       : ok=2    changed=0    unreachable=0    failed=1   \r\nansible-container_1  |  [WARNING]: Could not create retry file 'main.retry'.         [Errno 2] No such\r\nansible-container_1  | file or directory: ''\r\nansible-container_1  | \r\nansible_ansible-container_1 exited with code 1\r\nAborting on container exit...\r\nStopping ansible_ldap_1 ... done\r\nAnsible playbook run failed.\r\nCleaning up Ansible Container builder...\r\nAnsible build failed\r\n```\r\n##### Second build\r\ni modify main.yml, uncommenting the two lines concerning python : \r\n\r\n    - name: Install python \r\n      raw: apt-get install -y python python-apt\r\n\r\ni rebuild the image, ansible-container will be OK now.\r\n```\r\n$ ansible-container build\r\nNo DOCKER_HOST environment variable found. Assuming UNIX socket at /var/run/docker.sock\r\nStarting Docker Compose engine to build your images...\r\nAttaching to ansible_ansible-container_1\r\nCleaning up Ansible Container builder...\r\nNo image found for tag geosync-ldap:latest, so building from scratch\r\nAttaching to ansible_ansible-container_1, ansible_ldap_1\r\nansible-container_1  | Host ldap running\r\nansible-container_1  | \r\nansible-container_1  | PLAY [ldap] ********************************************************************\r\nansible-container_1  | \r\nansible-container_1  | TASK [Update all packages] *****************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Install ldap-utils] ******************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Install python] **********************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy groupofmembers.ldif] ************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy member.ldif] ********************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy georchestra.ldif] ***************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy groupofmembers.ldif] ************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Create docker-entrypoint.d directory] ************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy 00-populate] ********************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy docker-entrypoint.sh] ***********************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | PLAY RECAP *********************************************************************\r\nansible-container_1  | ldap                       : ok=10   changed=7    unreachable=0    failed=0   \r\nansible-container_1  | \r\nansible_ansible-container_1 exited with code 0\r\nAborting on container exit...\r\nStopping ansible_ldap_1 ... done\r\nExporting built containers as images...\r\nCommitting image...\r\nExported geosync-ldap with image ID sha256:0c4f1d4c2e5a214069c44d8cafb47e6cdf5d1b94da6fb28bb02f2a56b9e8ef01\r\nCleaning up ldap build container...\r\nCleaning up Ansible Container builder...\r\n```\r\n##### Third build\r\nnow, i can comment the two lines concerning python, they are no more necessary, and the build will be OK !\r\n```\r\n#    - name: Install python \r\n#      raw: apt-get install -y python python-apt\r\n```\r\n\r\n```\r\n$ ansible-container build\r\nNo DOCKER_HOST environment variable found. Assuming UNIX socket at /var/run/docker.sock\r\nStarting Docker Compose engine to build your images...\r\nAttaching to ansible_ansible-container_1\r\nCleaning up Ansible Container builder...\r\nAttaching to ansible_ansible-container_1, ansible_ldap_1\r\nansible-container_1  | Host ldap running\r\nansible-container_1  | \r\nansible-container_1  | PLAY [ldap] ********************************************************************\r\nansible-container_1  | \r\nansible-container_1  | TASK [Update all packages] *****************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Install ldap-utils] ******************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy groupofmembers.ldif] ************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy member.ldif] ********************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy georchestra.ldif] ***************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy groupofmembers.ldif] ************************************************\r\nansible-container_1  | changed: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Create docker-entrypoint.d directory] ************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy 00-populate] ********************************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | TASK [Copy docker-entrypoint.sh] ***********************************************\r\nansible-container_1  | ok: [ldap]\r\nansible-container_1  | \r\nansible-container_1  | PLAY RECAP *********************************************************************\r\nansible-container_1  | ldap                       : ok=9    changed=2    unreachable=0    failed=0   \r\nansible-container_1  | \r\nansible_ansible-container_1 exited with code 0\r\nAborting on container exit...\r\nStopping ansible_ldap_1 ... done\r\nExporting built containers as images...\r\nCommitting image...\r\nExported geosync-ldap with image ID sha256:34321d62f0cc6df319e51940528ea411676a4c7eaa765cf99ebbc4dfca265a6d\r\nCleaning up ldap build container...\r\nCleaning up Ansible Container builder...\r\n```\r\nand so on for the future builds...\r\ni just need to install python one time and everything falls into place.\r\n\r\nremember: you need to erase everything before testing that.\r\n```\r\ndocker rm -f $(docker ps -a -q) && docker rmi -f $(docker images -q) && docker volume rm `docker volume ls -q` && docker ps -a | cut -c-12 | xargs docker rm\r\n```\r\n\r\nI restarted 3 times before describing the problem here...\r\n\r\nhope it helps,\r\n\r\nErnest.\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-container/issues/comments/250749478","html_url":"https://github.com/ansible/ansible-container/issues/264#issuecomment-250749478","issue_url":"https://api.github.com/repos/ansible/ansible-container/issues/264","id":250749478,"user":{"login":"MaxiReglisse","id":11272821,"avatar_url":"https://avatars.githubusercontent.com/u/11272821?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxiReglisse","html_url":"https://github.com/MaxiReglisse","followers_url":"https://api.github.com/users/MaxiReglisse/followers","following_url":"https://api.github.com/users/MaxiReglisse/following{/other_user}","gists_url":"https://api.github.com/users/MaxiReglisse/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxiReglisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxiReglisse/subscriptions","organizations_url":"https://api.github.com/users/MaxiReglisse/orgs","repos_url":"https://api.github.com/users/MaxiReglisse/repos","events_url":"https://api.github.com/users/MaxiReglisse/events{/privacy}","received_events_url":"https://api.github.com/users/MaxiReglisse/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T13:51:36Z","updated_at":"2016-09-30T13:51:36Z","body":"you said : \r\n\"I assume what you're asking for Ansible Container to do is detect when python is missing, and if so, attempt to install it.\"\r\nNo !\r\ni do not need to install Python in the ldap container, i just want to copy a file, and for that, it is sometimes necessary to install Python.\r\nmy opinion is that it is an ansible-container bug."}}
{"actor":{"display_login":"MaxiReglisse"}}