Hallo,
ich mache meine ersten Gehversuche mit Ansible und möchte ein Playbook schreiben.
Das habe ich bereits:
---
- hosts: kolumbus
become: yes
tasks:
- name: Copy RPM
copy:
src: "{{ item }}"
dest: /tmp
with_fileglob:
- /opt/omd/versions/default/share/check_mk/agents/check-mk-agent-*.noarch.rpm
register: copied_file
- debug: var=copied_fileAusgabe von Debug:
TASK [debug] **********************************************************************************************************************************************************************************
ok: [kolumbus] => {
"copied_file": {
"changed": false,
"msg": "All items completed",
"results": [
{
"_ansible_ignore_errors": null,
"_ansible_item_result": true,
"_ansible_no_log": false,
"_ansible_parsed": true,
"changed": false,
"checksum": "55ae455adc639f9cfca738683b5955f32e78d2db",
"dest": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm",
"diff": {
"after": {
"path": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm"
},
"before": {
"path": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm"
}
},
"failed": false,
"gid": 0,
"group": "root",
"invocation": {
"module_args": {
"attributes": null,
"backup": null,
"content": null,
"delimiter": null,
"dest": "/tmp",
"diff_peek": null,
"directory_mode": null,
"follow": false,
"force": false,
"group": null,
"mode": null,
"original_basename": "check-mk-agent-1.5.0p5-1.noarch.rpm",
"owner": null,
"path": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm",
"recurse": false,
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "check-mk-agent-1.5.0p5-1.noarch.rpm",
"state": "file",
"unsafe_writes": null,
"validate": null
}
},
"item": "/opt/omd/versions/default/share/check_mk/agents/check-mk-agent-1.5.0p5-1.noarch.rpm",
"mode": "0644",
"owner": "root",
"path": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm",
"secontext": "unconfined_u:object_r:user_home_t:s0",
"size": 32768,
"state": "file",
"uid": 0
}
]
}
}Wie komme ich an den Wert "dest": "/tmp/check-mk-agent-1.5.0p5-1.noarch.rpm" damit ich es in einem weiteren Task verwenden kann???