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:
rev: v0.10.0
hooks:
- 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
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
hosts:
- pkg_mgr_apt
- host01
- ns4
tags:
- debian
- update
......@@ -21,7 +12,7 @@
- name: Bootstrap OpenWRT hosts
hosts:
- pkg_mgr_opkg
- ea6350
tags:
- openwrt
- update
......@@ -31,7 +22,7 @@
- name: Bootstrap OpenBSD hosts
hosts:
- pkg_mgr_openbsd_pkg
- ns1
tags:
- openbsd
- update
......
......@@ -5,5 +5,4 @@
- ns4
roles:
- debian_server
become: true
become_user: root
- toolbox
......@@ -16,8 +16,10 @@ all:
ansible_host: host01.shore.co.il
vars:
# Force usage of Python3.
ansible_python_interpreter: python3
ansible_become: true
ansible_become_user: root
ansible_connection: ssh
ansible_python_interpreter: python3
children:
pkg_mgr_apt:
pkg_mgr_opkg:
......
......@@ -3,5 +3,3 @@
- kodi
roles:
- kodi
become: true
become_user: root
......@@ -3,5 +3,3 @@
- ns1
roles:
- 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