Skip to content
Snippets Groups Projects
Commit 8ff5d38c authored by nimrod's avatar nimrod
Browse files

Cleanup of playbooks.

- Set the become parameters in the inventory instead of adding it to all
  of the playbooks.
- Can't group by the package manager in the bootstrap playbook, can'
  gather facts, that's why the bootstrap is needed. Hard-code hosts.
- Delete the toolbox playbook, add the toolbox role to the debian_server
  playbook.
- Update list of playbooks in the pre-commit config.
parent a2cb8e70
No related branches found
No related tags found
No related merge requests found
Pipeline #510 passed
...@@ -45,7 +45,8 @@ repos: ...@@ -45,7 +45,8 @@ repos:
rev: v0.10.0 rev: v0.10.0
hooks: hooks:
- id: ansible-syntax-check - id: ansible-syntax-check
files: (bootstrap|update|renew-certs|debian_server|kodi)\.yaml # yamllint disable-line rule:line-length
files: (bootstrap|update|renew-certs|debian_server|kodi|router)\.yaml
- repo: https://github.com/ansible/ansible-lint - repo: https://github.com/ansible/ansible-lint
rev: v4.3.7 rev: v4.3.7
......
--- ---
- name: Group hosts by package manager
hosts:
- all
tasks:
- name: Group hosts by package manager
group_by:
key: pkg_mgr_{{ ansible_pkg_mgr }}
tags:
- always
- name: Bootstrap Debian hosts - name: Bootstrap Debian hosts
hosts: hosts:
- pkg_mgr_apt - host01
- ns4
tags: tags:
- debian - debian
- update - update
...@@ -21,7 +12,7 @@ ...@@ -21,7 +12,7 @@
- name: Bootstrap OpenWRT hosts - name: Bootstrap OpenWRT hosts
hosts: hosts:
- pkg_mgr_opkg - ea6350
tags: tags:
- openwrt - openwrt
- update - update
...@@ -31,7 +22,7 @@ ...@@ -31,7 +22,7 @@
- name: Bootstrap OpenBSD hosts - name: Bootstrap OpenBSD hosts
hosts: hosts:
- pkg_mgr_openbsd_pkg - ns1
tags: tags:
- openbsd - openbsd
- update - update
......
...@@ -5,5 +5,4 @@ ...@@ -5,5 +5,4 @@
- ns4 - ns4
roles: roles:
- debian_server - debian_server
become: true - toolbox
become_user: root
...@@ -16,8 +16,10 @@ all: ...@@ -16,8 +16,10 @@ all:
ansible_host: host01.shore.co.il ansible_host: host01.shore.co.il
vars: vars:
# Force usage of Python3. # Force usage of Python3.
ansible_python_interpreter: python3 ansible_become: true
ansible_become_user: root
ansible_connection: ssh ansible_connection: ssh
ansible_python_interpreter: python3
children: children:
pkg_mgr_apt: pkg_mgr_apt:
pkg_mgr_opkg: pkg_mgr_opkg:
......
...@@ -3,5 +3,3 @@ ...@@ -3,5 +3,3 @@
- kodi - kodi
roles: roles:
- kodi - kodi
become: true
become_user: root
...@@ -3,5 +3,3 @@ ...@@ -3,5 +3,3 @@
- ns1 - ns1
roles: roles:
- router - router
become: true
become_user: root
---
- hosts:
- ns4
- localhost
roles:
- toolbox
become: true
become_user: root
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment