docker installation with ansible

255 views
Skip to first unread message

rebecca acheampong

unread,
Apr 21, 2021, 7:49:02 AM4/21/21
to Ansible Project
I am trying to install docker on one of my VMs on esxi, but i get this error
my playbook is below the error

PLAY [installing docker on ubuntu] *********************************************

TASK [vmware_guest] ************************************************************
ok: [localhost] => (item=my_vm_01)

TASK [adding docker gpg key] ***************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to download key at https://download.docker.com/linux/ubuntu/gpg: An unknown error occurred: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/root/.netrc, line 3)"}

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

---
- name: installing docker on ubuntu
  hosts: localhost
  remote_user: "{{ remote_user_name }}"
  gather_facts: no
  become: yes
  vars_files:
     - var_docker.yml
  vars:
   remote_user_name: cyber01
   apt_repo_data: "deb [arch=amd64]
  tasks:
    - vmware_guest:
        hostname: "{{ VMWARE_HOST }}"
        username: "{{ VMWARE_USER }}"
        password: "{{ VMWARE_PASSWORD }}"
        validate_certs: no
        folder: /ha-datacenter/vm/
        name: "{{ item }}"
      with_items:
         - my_vm_01
    - name: adding docker gpg key
      apt_key:
        url: "{{ apt_gpg_key }}"
        state: present
    - name: add docker repository
      apt_repository:
   repo: "{{ apt_repo_data }}"
        state: present
    - name: installing docker-ce
      apt:
        name: docker-ce
        state: present
        update_cache: yes
    - name: install python-pip
      apt:
        name: python-pip
        state: present
    - name: install docker-py
      pip:
        name: "{{ item }}"
        state: present
      with_items:
        - docker-py


Dick Visser

unread,
Apr 21, 2021, 9:33:38 AM4/21/21
to ansible...@googlegroups.com
I don't think the error can be any clearer:

On Wed, 21 Apr 2021 at 13:49, rebecca acheampong <bec1...@gmail.com> wrote:

~/.netrc access too permissive: access permissions must restrict access to only the owner (/root/.netrc, line 3)"}





--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Komal Suthar

unread,
Apr 21, 2021, 10:21:22 AM4/21/21
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwOpk0DPhuczrhb5h1v4nsWuBMRcs2SSOP_iQ2Red6M0WA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages