From 332573ae82b9ab65dc3e2df140c1449fe4f81f59 Mon Sep 17 00:00:00 2001 From: binary Date: Tue, 19 Jan 2021 23:05:30 +0100 Subject: Rewrite basic roles with simple syntax --- roles/dns/tasks/main.yml | 2 +- roles/tools/tasks/main.yml | 29 ++++++++--------------------- roles/users/tasks/main.yml | 2 +- 3 files changed, 10 insertions(+), 23 deletions(-) (limited to 'roles') diff --git a/roles/dns/tasks/main.yml b/roles/dns/tasks/main.yml index 41cfe8e..3e84009 100644 --- a/roles/dns/tasks/main.yml +++ b/roles/dns/tasks/main.yml @@ -4,7 +4,7 @@ --- -- name: ensure dns +- name: ensure dns are up to date template: src: resolv.conf.j2 dest: /etc/resolv.conf diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml index fae66c6..5e8dada 100644 --- a/roles/tools/tasks/main.yml +++ b/roles/tools/tasks/main.yml @@ -7,37 +7,24 @@ - set_fact: packages: "{{ packages[ansible_distribution | lower] }}" -- name: install sysadmin tools - package: state=present name="{{ item }}" - loop: - - tmux - - htop - - "{{ ansible_become_method }}" - #failed_when: false - ignore_errors: true - - name: install per distribution correspond tools package: state=present name="{{ item }}" loop: - - "{{ packages.neovim }}" - "{{ packages.sshfs }}" - "{{ packages.wireguard }}" - "{{ packages.extra if packages.extra is defined }}" ignore_errors: true -- name: install misc utils - package: state=present name="{{ item }}" + +- name: install global utils + package: name="{{ item }}" state=present loop: - - figlet - curl - - wget + - figlet - git + - htop + - neovim + - tmux + - wget - zsh - #failed_when: false ignore_errors: true - -- name: install scripts repository - git: - repo: "https://gitlab.com/rgoncalves.se/infrastructure/infrastructure-scripts" - dest: /data/scripts - force: true diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml index 0a0e259..7c37a30 100644 --- a/roles/users/tasks/main.yml +++ b/roles/users/tasks/main.yml @@ -34,5 +34,5 @@ owner: root group: "{{ group_root }}" mode: 0644 - when: ansible_become_method == "doas" + when: ansible_become_method == "doas" or ansible_distribution == "OpenBSD" -- cgit v1.2.3