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
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+4 −13
Original line number Diff line number Diff line
---
- 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
+1 −2
Original line number Diff line number Diff line
@@ -5,5 +5,4 @@
    - ns4
  roles:
    - debian_server
  become: true
  become_user: root
    - toolbox
+3 −1
Original line number Diff line number Diff line
@@ -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:
+0 −2
Original line number Diff line number Diff line
@@ -3,5 +3,3 @@
    - kodi
  roles:
    - kodi
  become: true
  become_user: root
Loading