Estou tendo o seguinte yaml ansible-playbook e quero transferir os rpms e, em seguida, instalá-los localmente na máquina remota. Até a etapa de transferência do arquivo está funcionando bem, no entanto, na parte da instalação, estou recebendo o seguinte erro: "Failure talking to yum: near \"gskcrypt64\": syntax error"
Alguma idéia de como superar essa parte?
Versão Ansible:
ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Manual do Ansible:
---
- hosts: "1.2.3.4"
connection: "ssh"
vars:
RPM:
- gskcrypt64-8.0.50.86.linux.ppcle.rpm
- gskssl64-8.0.50.86.linux.ppcle.rpm
- TIVsm-API64.ppc64le.rpm
- TIVsm-BA.ppc64le.rpm
tasks:
- name: "Transfer Files"
copy: src=/root/ansible_playbooks/{{ item }} dest=/root/
with_items: "{{ RPM }}"
- name: "Install Local RPMs"
shell: yum localinstall -y /root/*.rpm
O mesmo erro é relatado se eu alterar o módulo shell com
- name: "Install Local RPMs"
yum:
name: /root/{{ RPM }}
state: present
Erro:
root@server [/root/ansible_playbooks] > ansible-playbook tsm
PLAY [1.2.3.4] ******************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************
ok: [1.2.3.4]
TASK [Transfer Files] ****************************************************************************************************************************************************************************************************
ok: [1.2.3.4] => (item=gskcrypt64-8.0.50.86.linux.ppcle.rpm)
ok: [1.2.3.4] => (item=gskssl64-8.0.50.86.linux.ppcle.rpm)
ok: [1.2.3.4] => (item=TIVsm-API64.ppc64le.rpm)
ok: [1.2.3.4] => (item=TIVsm-BA.ppc64le.rpm)
TASK [Install Local RPMs] ************************************************************************************************************************************************************************************************
fatal: [1.2.3.4]: FAILED! => {"changed": false, "msg": "Failure talking to yum: near \"gskcrypt64\": syntax error"}
to retry, use: --limit @/root/ansible_playbooks/tsm.retry
PLAY RECAP ***************************************************************************************************************************************************************************************************************
1.2.3.4 : ok=2 changed=0 unreachable=0 failed=1
Edit1 : tentei o seguinte loop, pois os arquivos já estão do outro lado:
---
- hosts: "1.2.3.4"
connection: "ssh"
vars:
RPM:
- gskcrypt64-8.0.50.86.linux.ppcle.rpm
- gskssl64-8.0.50.86.linux.ppcle.rpm
- TIVsm-API64.ppc64le.rpm
- TIVsm-BA.ppc64le.rpm
tasks:
- name: "Install Local RPMs"
yum:
name: /root/"{{ item }}"
state: present
loop: "{{ RPM }}"
Agora recebendo o seguinte erro:
fatal: [1.2.3.4]: FAILED! => {"msg": "Unexpected failure in finding the lookup named '{{ RPM }}' in the available lookup plugins"}
Editar2:
Tentei mover e testar na parte com falha do yum localinstall:
---
- hosts: "1.2.3.4"
connection: "ssh"
vars:
RPM:
- gskcrypt64-8.0.50.86.linux.ppcle.rpm
- gskssl64-8.0.50.86.linux.ppcle.rpm
- TIVsm-API64.ppc64le.rpm
- TIVsm-BA.ppc64le.rpm
tasks:
- name: "Install Local RPMs"
yum:
name: "/root/{{RPM}}"
state: present
mas recebendo o erro:
fatal: [1.2.3.4]: FAILED! => {"changed": false, "msg": "Failure talking to yum: near \"gskcrypt64\": syntax error"}