Ivan
привет
у меня какая-то странная проблема, может кто сталкивался?
есть такая таска:
- name: Download postgres_exporter from {{ postgres_exporter_download_url }}
unarchive:
src: "{{ postgres_exporter_download_url }}"
dest: "{{ postgres_exporter_bin_dir }}"
extra_opts:
- "--strip-components 1"
- "postgres_exporter-{{ postgres_exporter_version }}.linux-amd64/postgres_exporter"
owner: "{{ postgres_exporter_system_user }}"
group: "{{ postgres_exporter_system_group }}"
remote_src: true
when:
- not ansible_check_mode
- postgres_exporter_is_installed.stat.exists == False or
postgres_exporter_version not in postgres_exporter_current_version.stdout
использую awx, и в нем такие таски почему-то фейлятся
в разных ролях где пытаюсь на лету выкладывать файлы из архива в конкретное место на сервере
вывод awx’a:
{
"msg": "Failed to find handler for \"/home/ansible/.ansible/tmp/ansible-tmp-1668255504.1867397-25053-115043183377490/postgres_exporter-0.11.1.linux-amd64.tarC4FgBC.gz\". Make sure the required command to extract the file is installed. Command \"/usr/bin/tar\" could not handle archive. Command \"unzip\" not found.",
"invocation": {
"module_args": {
"exclude": [],
"directory_mode": null,
"force": null,
"remote_src": true,
"follow": false,
"owner": "postgres",
"extra_opts": [
"--strip-components 1",
"postgres_exporter-0.11.1.linux-amd64/postgres_exporter"
],
"group": "postgres",
"unsafe_writes": null,
"keep_newer": false,
"setype": null,
"content": null,
"serole": null,
"dest": "/usr/local/bin",
"selevel": null,
"regexp": null,
"src": "https://github.com/prometheus-community/postgres_exporter/releases/download/v0.11.1/postgres_exporter-0.11.1.linux-amd64.tar.gz",
"validate_certs": true,
"list_files": false,
"seuser": null,
"creates": null,
"delimiter": null,
"mode": null,
"attributes": null,
"backup": null
}
},
"_ansible_no_log": false,
"changed": false
}
мне бросается в глаза что в имя скачанного архива добавляется какая-то абракадабра (между tar и `gz`)
/home/ansible/.ansible/tmp/ansible-tmp-1668255504.1867397-25053-115043183377490/postgres_exporter-0.11.1.linux-amd64.tarC4FgBC.gz
кто-нить что-нить знает об этом?
Дмитрий
TASK [Download postgres_exporter from {{ postgres_exporter_download_url }}] ******************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to find handler for \"/home/k3nguru/.ansible/tmp/ansible-tmp-1668257714.8357322-48911-272320770810355/postgres_exporter-0.11.1.linux-amd64.tar4z63rxcm.gz\". Make sure the required command to extract the file is installed. Command \"/usr/bin/unzip\" could not handle archive. Command \"/usr/bin/gtar\" could not handle archive."}
Дмитрий
- name: Download postgres_exporter from {{ postgres_exporter_download_url }}
unarchive:
src: 'https://github.com/prometheus-community/postgres_exporter/releases/download/v0.11.1/postgres_exporter-0.11.1.linux-amd64.tar.gz'
dest: "./"
extra_opts:
- "--strip-components=1"
- "postgres_exporter-0.11.1.linux-amd64/postgres_exporter"
remote_src: true
Ayrat
Всем привет!
В курсе по Ансибл есть задание - насоздавать на удалённой машине юзеров (это я сделал), а потом положить им в папки публичные ключи. Задание звучит так:
————————
Добавьте таски для загрузки публичного ключа для каждого пользователя. Ключи на сервере должны находиться по пути /home//.ssh/authorized_keys. Ваш публичный ключ должен находиться в директории files/ в рабочей директории
————————
Я так не понял, я могу свой ssh публичный ключ скопировать каждому, что ли?
...или как?
Заранее спасибо!
Thorvald
подскажите, есть ли возможность в модуле при написании жестко задавать необходимость выполнения на сервере, а не на удаленном хосте?
(речь о своем, самописном модуле)