geerlingguy / ansible-role-docker_arm

Ansible Role - Docker for ARM and Pi
MIT License
98 stars 29 forks source link

Permissions issues #1

Closed mpataki closed 5 years ago

mpataki commented 5 years ago

I'm running this role with defaults on a freshly installed rasbian lite official image and running into permissions issues.

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ***************************************************
 [WARNING]: Updating cache and auto-installing missing dependency: python-apt

fatal: [docker-pi-3]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)\nE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)\nE: Unable to lock directory /var/lib/apt/lists/\nW: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)\nW: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)", "rc": 100, "stderr": "W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)\nE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)\nE: Unable to lock directory /var/lib/apt/lists/\nW: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)\nW: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)\n", "stderr_lines": ["W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)", "E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)", "E: Unable to lock directory /var/lib/apt/lists/", "W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)", "W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)"], "stdout": "Reading package lists...\n", "stdout_lines": ["Reading package lists..."]}
ansible --version 
ansible 2.8.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mat/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127]

I'm using the default pi user as the ansible_user.

I've also hit a similar issue with your very popular pip role (although this example isn't using it), so I'm assuming the issue is on my end somewhere.

Thanks in advance

geerlingguy commented 5 years ago

In this case, your playbook should add a become: true to the top after the hosts line. Alternately, you can just use become for this one role with:

  roles:
    - role: geerlingguy.docker_arm
      become: true