Цель: загрузить банку с артефактом из нексуса на целевой сервер.Я уже пытался попытаться загрузить банку через URL, а не через maven_artifact, но в любом случае это было успешно.Но я хотел попробовать с командой maven_artifact
Код в playbook:
---
- name: TestOfMavenArtifactCommand
hosts: Target_Server_Where_the_Jar_needs_to_be_downloaded
tasks:
- maven_artifact:
group_id: ab.cdef.group
artifact_id: artifact_name
repository_url: 'https://nexusUrl/repository/maven-snapshots'
dest: /folder/artifact_name.jar
username: user
state: present
mode: 0755
Когда я запускаю задание Rundeck, оно не выполняется.Ошибка выглядит так:
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible-playbook
python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Using /etc/ansible/ansible.cfg as config file
Parsed /var/lib/rundeck/work/zxcv-folder-services/scpr-inventory_dev/dev/hosts.yml inventory source with ini plugin
[WARNING]: Ignoring invalid attribute: username
[WARNING]: Ignoring invalid attribute: artifact_id
[WARNING]: Ignoring invalid attribute: dest
[WARNING]: Ignoring invalid attribute: state
[WARNING]: Ignoring invalid attribute: mode
[WARNING]: Ignoring invalid attribute: repository_url
[WARNING]: Ignoring invalid attribute: group_id
PLAYBOOK: main.yml *************************************************************
1 plays in main.yml
fatal: [server00.companyxxx.dev ]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"artifact_id": null,
"attributes": null,
"backup": null,
"classifier": "",
"content": null,
"delimiter": null,
"dest": null,
"directory_mode": null,
"extension": "jar",
"follow": false,
"force": null,
"group": null,
"group_id": null,
"keep_name": false,
"mode": null,
"owner": null,
"password": null,
"regexp": null,
"remote_src": null,
"repository_url": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "devsent",
"timeout": 10,
"unsafe_writes": null,
"username": null,
"validate_certs": true,
"version": "latest"
}
},
"msg": "group_id must be set"
}
to retry, use: --limit @/var/lib/rundeck/work/abcd-batch-services/scpr-servers-operations_dev/deploy-servers/tasks/main.retry
Следуют ссылки на это: https://docs.ansible.com/ansible/latest/modules/maven_artifact_module.html