Пофиксил униерсальность и добавил centos и ubuntu

This commit is contained in:
2025-03-13 17:38:44 +03:00
parent 0c3bacfe9c
commit b6286aa9b7
28 changed files with 229 additions and 101 deletions

View File

@@ -1,6 +1,11 @@
---
- name: Deploy roles
hosts: production
hosts: all
become: true
become_user: root
become_method: ansible.builtin.sudo
gather_facts: true
roles:
- role
vars_files:
- ../vars/secrets.yml

View File

@@ -0,0 +1,4 @@
---
- name: Пример таски
debug:
msg: "Привет! Я запустился на Debian/Ubuntu! Переменная role_test равна {{ role_test }}"

View File

@@ -1,4 +1,12 @@
---
- name: Example task
debug:
msg: "Hello, Ansible!"
- name: "Определяем ОС"
set_fact:
os_family: "{{ ansible_facts['os_family'] }}"
- name: "Подключаем таски для RedHat совместимых"
include_tasks: "redhat/main.yaml"
when: os_family == "RedHat"
- name: "Подключаем таски для Debian/Ubuntu совместимых"
include_tasks: "debian/main.yaml"
when: os_family == "Debian"

View File

@@ -0,0 +1,4 @@
---
- name: Пример таски
debug:
msg: "Привет! Я запустился на RedHat/CentOS/Fedora!"

View File

@@ -1,6 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
30363439326335316131303133653930363431336539356134363933656566663330366165616366
6639353565306634613164636161353362643237353933610a323838666436363835303765323930
62333364613535656138623233666635303934376234633937666131366239323436333334646666
6364303839396532310a633636333665346538313931366666333665363163623966666236346666
6464