add utils role
This commit is contained in:
parent
93d140015b
commit
818a7aaefd
@ -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 }}"
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
sys_utils:
|
|
||||||
- git
|
|
||||||
- vim
|
|
||||||
- tmux
|
|
||||||
- dnsutils
|
|
||||||
- ldnsutils
|
|
||||||
- tcpdump
|
|
||||||
|
|
||||||
# vim:ft=yaml.ansible:
|
|
31
roles/util/defaults/main.yaml
Normal file
31
roles/util/defaults/main.yaml
Normal 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
|
10
roles/util/tasks/Ubuntu.yaml
Normal file
10
roles/util/tasks/Ubuntu.yaml
Normal 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 }}"
|
30
roles/util/tasks/main.yaml
Normal file
30
roles/util/tasks/main.yaml
Normal 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 }}"
|
0
roles/util/vars/default.yaml
Normal file
0
roles/util/vars/default.yaml
Normal file
Loading…
Reference in New Issue
Block a user