add utils role

This commit is contained in:
Ryan Cavicchioni 2019-12-13 21:48:59 -06:00
parent 93d140015b
commit 818a7aaefd
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
6 changed files with 71 additions and 16 deletions

View File

@ -15,12 +15,6 @@
hostname: hostname:
name: "{{ hostname | default(inventory_hostname) }}" name: "{{ hostname | default(inventory_hostname) }}"
- name: install system utilities
package:
name: "{{ item }}"
state: present
with_items: "{{ sys_utils }}"
- name: configure system timezone - name: configure system timezone
timezone: timezone:
name: "{{ timezone }}" name: "{{ timezone }}"

View File

@ -1,10 +0,0 @@
---
sys_utils:
- git
- vim
- tmux
- dnsutils
- ldnsutils
- tcpdump
# vim:ft=yaml.ansible:

View File

@ -0,0 +1,31 @@
---
util_vim_ppa_state: present
util_git_ppa_state: present
util_package_state: latest
util_packages:
editors:
- vim
devel:
- git
- mercurial
- fossil
network:
- nmap
- tcpdump
- curl
- wget
- lftp
- rsync
- dnsutils
- ldnsutils
- sipcalc
math:
- bc
misc:
- tmux
- moreutils
security:
- gnupg
- pass

View File

@ -0,0 +1,10 @@
---
- name: add vim ppa
apt_repository:
repo: ppa:jonathonf/vim
state: "{{ util_vim_ppa_state }}"
- name: add git ppa
apt_repository:
repo: ppa:git-core/ppa
state: "{{ util_git_ppa_state }}"

View File

@ -0,0 +1,30 @@
---
- name: gather os specific variables
include_vars: "{{ lookup('first_found', possible_files) }}"
vars:
possible_files:
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- vars
- name: include os specific tasks
include_tasks: "{{ lookup('first_found', possible_files) }}"
vars:
possible_files:
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- tasks
- name: install packages
package:
name: "{{ item.value }}"
state: "{{ util_package_state }}"
loop: "{{ (util_packages | default({})) | dict2items }}"

View File