user72
(Алексей Гаврилов)
1
add a variable that takes the value of the initialization
http://docs.ansible.com/ansible/playbooks_variables.html
“ansible_init”: “systemd”,
“ansible_init”: “SysV”,
“ansible_init”: “OpenRC”,
or
“ansible_init”: {
“systemd”: true,
“SysV”: true,
“OpenRC”: false
}
I was going with: ansible_service_mgr
user72
(Алексей Гаврилов)
4
- Partly I needed to branch the code in the playbook.
- name: check systemd
shell: "cat /proc/1/comm"
ignore_errors: yes
register: ansible_init
- include: 'systemd_setup.yml'
when: ansible_init.stdout.find('systemd') != -1
user72
(Алексей Гаврилов)
5
Your module does not do what I need.
I need a variable to the current system initialization.