centos - How to install yum repository key with ansible? -
i tried two ways:
- name: add repository yum_repository: # https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo name: passenger description: passenger repository baseurl: https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch repo_gpgcheck: 1 gpgcheck: 0 enabled: 1 gpgkey: https://packagecloud.io/gpg.key sslverify: 1 sslcacert: /etc/pki/tls/certs/ca-bundle.crt - name: add repository key (option 1) rpm_key: key: https://packagecloud.io/gpg.key - name: add repository key (option 2) command: rpm --import https://packagecloud.io/gpg.key - name: install nginx passenger yum: name={{ item }} with_items: [nginx, passenger]
but work, need ssh machine, confirm importing key (by running yum
command, e.g. yum list installed
), , continue provisioning. there way automatically?
upd here's ansible
says:
task [nginx : add repository key] ********************************************** changed: [default] task [nginx : install nginx passenger] ************************************ failed: [default] (item=[u'nginx', u'passenger']) => {"failed": true, "item": ["nginx", "passenger"], "msg": "failure talking yum: failure: repodata/repomd.xml passenger: [errno 256] no more mirrors try.\nhttps://oss-binaries.phusionpassen ger.com/yum/passenger/el/7/x86_64/repodata/repomd.xml: [errno -1] repomd.xml signature not verified passenger"}
so, key indeed imported in both cases, used must confirmed.
fixed running yum
directly -y
switch (and using rpm_key
module, if anything):
- name: install nginx passenger command: yum -y install {{ item }} with_items: [nginx, passenger]
Comments
Post a Comment