From d89d235b35224da3b41ab7fb0c7ea653334790b4 Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Sun, 17 Aug 2025 12:34:41 +0300 Subject: [PATCH] add ansible install part of installs role --- playbooks/box.yml | 5 +++-- playbooks/host.yml | 5 +++-- roles/installs/tasks/ansible.yml | 10 ++++++++++ roles/installs/tasks/cli.yml | 2 -- roles/installs/tasks/main.yml | 4 ++++ 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 roles/installs/tasks/ansible.yml diff --git a/playbooks/box.yml b/playbooks/box.yml index aff664d..6567851 100644 --- a/playbooks/box.yml +++ b/playbooks/box.yml @@ -9,6 +9,7 @@ - ssh - scripts apps: + - ansible - cli vars_prompt: - name: tools_in @@ -19,9 +20,9 @@ ansible.builtin.set_fact: tools: "{{ tools_in.split(',') }}" roles: - # link and copy dotfiles - - role: dotfiles # install apps - role: installs + # link and copy dotfiles + - role: dotfiles # install and setup dev tools - role: dev diff --git a/playbooks/host.yml b/playbooks/host.yml index 907528e..2da5dad 100644 --- a/playbooks/host.yml +++ b/playbooks/host.yml @@ -18,15 +18,16 @@ - ssh - scripts apps: + - ansible - cli pre_tasks: - name: Get tools list ansible.builtin.set_fact: tools: "{{ tools_in.split(',') }}" roles: - # link and copy dotfiles - - role: dotfiles # install apps - role: installs + # link and copy dotfiles + - role: dotfiles # install and setup dev tools - role: dev diff --git a/roles/installs/tasks/ansible.yml b/roles/installs/tasks/ansible.yml new file mode 100644 index 0000000..b0a8f74 --- /dev/null +++ b/roles/installs/tasks/ansible.yml @@ -0,0 +1,10 @@ +- name: Installing ansible packages + become: true + ansible.builtin.dnf5: + name: + - ansible + - ansible-lint + - python3-github3py + - python3-rpm + state: latest + diff --git a/roles/installs/tasks/cli.yml b/roles/installs/tasks/cli.yml index 6c08482..e63fe34 100644 --- a/roles/installs/tasks/cli.yml +++ b/roles/installs/tasks/cli.yml @@ -28,8 +28,6 @@ - git # other - - ansible - - ansible-lint - cronie state: latest diff --git a/roles/installs/tasks/main.yml b/roles/installs/tasks/main.yml index c75534e..c158176 100644 --- a/roles/installs/tasks/main.yml +++ b/roles/installs/tasks/main.yml @@ -1,3 +1,7 @@ +- name: Installing ansible packages + ansible.builtin.import_tasks: ansible.yml + when: "'ansible' in apps" + - name: Installing common cli apps ansible.builtin.import_tasks: cli.yml when: "'cli' in apps"