Error saying "Failed to find required executable gpg in paths"

0 votes

I have a role to install Docker. 

   - name: Install Docker and role dependencies
  apt:
    name: "{{ item }}"
    state: "present"
    install_recommends: False
  with_items:
    - "apt-transport-https"
    - "ca-certificates"
    - "software-properties-common"
    - "cron"

- name: Get upstream APT GPG key
  apt_key:
    id: "{{ docker_apt_key }}"
    keyserver: "{{ ansible_local.core.keyserver
                   if (ansible_local|d() and ansible_local.core|d() and
                       ansible_local.core.keyserver)
                   else 'hkp://pool.sks-keyservers.net' }}"
    state: "present"

- name: Configure upstream APT repository
  apt_repository:
    repo: "{{ docker_repository }}"
    state: "present"
    update_cache: True

- name: Install Docker
  apt:
    name: "docker-{{ docker_edition }}={{ docker_apt_package_name }}"
    state: "present"
    update_cache: True
    install_recommends: False
    cache_valid_time: "{{ docker_apt_cache_time }}"

But I get stuck with this error:

TASK [nickjj.docker : Install Docker and role dependencies] ************************************************************************************************************************************************
ok: [127.0.0.1] => (item=[u'apt-transport-https', u'ca-certificates', u'software-properties-common', u'cron'])

TASK [nickjj.docker : Get upstream APT GPG key] ************************************************************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to find required executable gpg in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}
    to retry, use: --limit @/home/skaouech/work/ansible/plays.retry
Mar 13 in Ansible by Nisha
157 views

1 answer to this question.

0 votes
Hey @Nisha, according to your error, your target host does not seem to have the gpg binary. install it using the apt package. Install gnupg using the apt package.

Hope that helps :)
answered Mar 13 by Yesha

Related Questions In Ansible

0 votes
1 answer

Error saying "Failed to find required executable npm in paths"

Hey @Thomas,  Seems like those extra paths have ...READ MORE

answered Jan 10 in Ansible by Naina
103 views
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer