46 lines
992 B
YAML
46 lines
992 B
YAML
---
|
|
- name: "create inventory folder {{ doku_path }}"
|
|
local_action:
|
|
module: file
|
|
path: "{{ doku_path }}"
|
|
state: directory
|
|
mode: 0755
|
|
run_once: True
|
|
|
|
- name: "[RPM] Install pythonX-rpm"
|
|
package:
|
|
name: "python{{ ansible_facts.python.version.major|replace('2', '') }}-rpm"
|
|
when: ansible_pkg_mgr in ["dnf", "zypper"]
|
|
|
|
- name: "[RPM] Install rpm-python"
|
|
package:
|
|
name: "rpm-python"
|
|
when: ansible_pkg_mgr in ["yum"]
|
|
|
|
- package_facts:
|
|
ignore_errors: True
|
|
|
|
- service_facts:
|
|
ignore_errors: True
|
|
|
|
- name: Get SSH version number
|
|
shell: 'ssh -V 2>&1 | grep -o "OpenSSH_[0-9]\+\.[0-9]" | grep -o "[0-9]\+\.[0-9]"'
|
|
changed_when: False
|
|
register: ssh_version
|
|
|
|
- name: write wiki page
|
|
local_action:
|
|
module: template
|
|
src: host.j2
|
|
dest: "{{ doku_path }}/{{ inventory_hostname|lower }}.txt"
|
|
|
|
- name: write index page
|
|
local_action:
|
|
module: template
|
|
src: start.j2
|
|
dest: "{{ doku_path }}/start.txt"
|
|
run_once: True
|
|
tags:
|
|
- indexonly
|
|
|