first pass

This commit is contained in:
Amarpreet Minhas 2020-08-20 00:02:35 -04:00
parent 5db0c5d226
commit f2cd627f30
10 changed files with 119 additions and 0 deletions

29
ansible/ansible.cfg Normal file
View file

@ -0,0 +1,29 @@
# config file for ansible -- Asara
# ===============================================
[defaults]
inventory = inventory/hosts
remote_tmp = ~/.ansible/tmp
local_tmp = ~/.ansible/tmp
forks = 5
poll_interval = 15
transport = smart
remote_port = 22
gathering = smart
roles_path = ./roles
stdout_callback = skippy
callback_whitelist = timer
timeout = 10
remote_user = cfgmgmt
private_key_file = ~/personal/keys/cfgmgmt
ansible_managed = "# Ansible managed | May be overwritten | Asara"
display_skipped_hosts = True
retry_files_enabled = False
[privilege_escalation]
become = True
become_method = sudo
become_user = root
[diff]
always = yes

View file

@ -0,0 +1,7 @@
---
# general
site_domain: minhas.io
# consul
consul_version: 1.8.3
...

4
ansible/inventory/hosts Normal file
View file

@ -0,0 +1,4 @@
[consul_server]
ivyking.minhas.io
fatman.minhas.io
sedan.minhas.io

View file

@ -0,0 +1,13 @@
---
- hosts: all
roles:
- role: common
- hosts: consul_server
roles:
- role: consul_server
- hosts: all:!consul_server
roles:
- role: consul
...

View file

@ -0,0 +1,35 @@
---
- name: apt update
apt:
update_cache: true
- name: apt upgrade
apt:
upgrade: yes
- name: apt dist-upgrade
apt:
upgrade: dist
- name: install default packages
apt:
name:
- dbus
- git
- htop
- inxi
- ncdu
- ntp
- rxvt-unicode-256color
- screen
- strace
- sysstat
- tmux
- tree
- vim
state: installed
- name: apt autoremove
apt:
autoremove: true
...

View file

@ -0,0 +1,15 @@
---
- name: Install default packages
pkgng:
name: "{{ packages }}"
vars:
packages:
- htop
- git
- ncdu
- ntp
- screen
- tmux
- tree
- vim
...

View file

@ -0,0 +1,3 @@
---
- include: "{{ ansible_os_family }}"
...

View file

@ -0,0 +1,6 @@
---
- name: get consul
unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
dest: /usr/local/bin/
remote_src: yes

View file

@ -0,0 +1,4 @@
---
- name: get consul
unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"

View file

@ -0,0 +1,3 @@
---
- include: "{{ ansible_os_family }}"
...