Alexander
Коллеги, всем привет!
Подскажите, плиз, а то что-то туплю сегодня.
Есть yaml типа такой структуры.
HEAD:
A:
a/name1: 01.02.03.4567
B:
b/name2: 01.02.03.4567
C:
c/name3: 01.02.03.4567
Надо вытащить по регекспу все конечные значения:
a/name1: 01.02.03.4567
b/name2: 01.02.03.4567
c/name3: 01.02.03.4567
Нюанс еще в том, что уровней может быть неизвестное количество равно как и названия уровней, так что считаем, что это неизвестные значения.
Yks
тестирую роль нод_експортера от комьюнити в молекуле в dind.
Возникла проблема с модулем unarchive. Когда запускаю в dind'е гитлаб раннером, то как будто не находит tar.
Когда запускаю в виртуалке на том же имадже с теми же настройками, то все нормально. В чем может быть проблема? Может что то с /tmp директорией не так в dind'е или с сохранением файла.
Проблемный лог
fatal: [instance -> localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"attributes": null,
"copy": true,
"creates": "/tmp/node_exporter-1.6.1.linux-amd64/node_exporter",
"decrypt": true,
"dest": "/tmp",
"exclude": [],
"extra_opts": [],
"group": null,
"include": [],
"io_buffer_size": 65536,
"keep_newer": false,
"list_files": false,
"mode": null,
"owner": null,
"remote_src": false,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "/root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source",
"unsafe_writes": false,
"validate_certs": true
}
}
}
MSG:
Failed to find handler for "/root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source". Make sure the required command to extract the file is installed.
Command "/bin/tar" detected as tar type None. GNU tar required.
Command "/usr/bin/unzip" could not handle archive: End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
note: /root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source may be a plain executable, not an archive
unzip: cannot find zipfile directory in one of /root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source or
/root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source.zip, and cannot find /root/.ansible/tmp/ansible-tmp-1693424126.1306684-774-56484539801541/source.ZIP, period.
Yks
Лог на ВМке где все норм.
changed: [instance -> localhost] => {
"changed": true,
"dest": "/tmp",
"extract_results": {
"cmd": [
"/usr/bin/tar",
"--extract",
"-C",
"/tmp",
"-z",
"-f",
"/home/yks/.ansible/tmp/ansible-tmp-1693424325.4169037-5458-237908086892127/source"
],
"err": "",
"out": "",
"rc": 0
},
"gid": 0,
"group": "root",
"handler": "TgzArchive",
"invocation": {
"module_args": {
"attributes": null,
"copy": true,
"creates": "/tmp/node_exporter-1.6.1.linux-amd64/node_exporter",
"decrypt": true,
"dest": "/tmp",
"exclude": [],
"extra_opts": [],
"group": null,
"include": [],
"io_buffer_size": 65536,
"keep_newer": false,
"list_files": false,
"mode": null,
"owner": null,
"remote_src": false,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "/home/yks/.ansible/tmp/ansible-tmp-1693424325.4169037-5458-237908086892127/source",
"unsafe_writes": false,
"validate_certs": true
}
},
"mode": "01777",
"owner": "root",
"size": 4096,
"src": "/home/yks/.ansible/tmp/ansible-tmp-1693424325.4169037-5458-237908086892127/source",
"state": "directory",
"uid": 0
}
Пробовал и с set_opts'ами и с become и без
Внутри контейнера на котором тестируется есть tar и он GNU
[root@instance /]# tar --version
tar (GNU tar) 1.26
Nick
Всем привет. Подскажите пожалуйста, почему при такой конфигурации тасков в роли, при прогоне на ОС CentOS7 play смотрит только в каталог debian/ и все пускает в skip ?
roles/
test-role/
tasks/
main.yml
debian/
run.yml
centos/
run.yml
tasks/main.yml содержит:
- import_tasks: debian/run.yml
when: ansible_distribution == "Debian" and ansible_distribution_major_version == "11"
- import_tasks: centos/run.yml
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
role play playbook
---
- hosts: server1
gather_facts: true
become: true
roles:
- test-role
Alex
Добрый день!
Подскажите пожалуйста по ошибке, не могу понять почему по умолчанию использует kerberos, даже если в host указано явно.
В какую сторону двигаться устранению ошибки?
В основном управляю windows хостами, но теперь надо еще RouterOS.
host:
routers:
hosts:
192.168.3.29
vars:
ansible_connection:ansible.netcommon.network_cli
ansible_network_os:community.routeros.routeros
ansible_user:admin
ansible_ssh_pass:password
playbook, взят отсюда как и hosts:
---
- name: RouterOS test with network_cli connection
hosts: routers
gather_facts: false
tasks:
- name: Run a command
community.routeros.command:
commands:
- /system resource print
register: system_resource_print
- name: Print its output
ansible.builtin.debug:
var: system_resource_print.stdout_lin
Ошибка такая:
[WARNING]: Unhandled error in Python interpreter discovery for host 192.168.3.29: kerberos: authGSSClientInit() failed:
(('Unspecified GSS failure. Minor code may provide more information', 851968), ("Can't find client principal admin@domain.local in
cache collection", -1765328243))
fatal: [192.168.3.29]: UNREACHABLE! => {"changed": false, "msg": "kerberos: authGSSClientInit() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), (\"Can't find client principal admin@domain.local in cache collection\", -1765328243))", "unreachable": true}
Aleksandr
Подскажите, Как настроить microtik на 2 провайдера, первый у меня dhcp авто ,а второй с логином и паролем - нужно в случае потери интернета чтобы один провайдер заменял другого
Aleks
День добрый, нужен совет по модулю reboot.
Если я запускаю плейбук от юзера -u myuser но после ребута дальше мне нужно чтобы ансибл подключался как root, как это можно реализовать?