first pass
This commit is contained in:
parent
5db0c5d226
commit
f2cd627f30
10 changed files with 119 additions and 0 deletions
29
ansible/ansible.cfg
Normal file
29
ansible/ansible.cfg
Normal 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
|
7
ansible/group_vars/all/main.yml
Normal file
7
ansible/group_vars/all/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
# general
|
||||||
|
site_domain: minhas.io
|
||||||
|
|
||||||
|
# consul
|
||||||
|
consul_version: 1.8.3
|
||||||
|
...
|
4
ansible/inventory/hosts
Normal file
4
ansible/inventory/hosts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[consul_server]
|
||||||
|
ivyking.minhas.io
|
||||||
|
fatman.minhas.io
|
||||||
|
sedan.minhas.io
|
13
ansible/playbooks/site.yml
Normal file
13
ansible/playbooks/site.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- role: common
|
||||||
|
|
||||||
|
- hosts: consul_server
|
||||||
|
roles:
|
||||||
|
- role: consul_server
|
||||||
|
|
||||||
|
- hosts: all:!consul_server
|
||||||
|
roles:
|
||||||
|
- role: consul
|
||||||
|
...
|
35
ansible/roles/common/tasks/Debian.yml
Normal file
35
ansible/roles/common/tasks/Debian.yml
Normal 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
|
||||||
|
...
|
15
ansible/roles/common/tasks/FreeBSD.yml
Normal file
15
ansible/roles/common/tasks/FreeBSD.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
- name: Install default packages
|
||||||
|
pkgng:
|
||||||
|
name: "{{ packages }}"
|
||||||
|
vars:
|
||||||
|
packages:
|
||||||
|
- htop
|
||||||
|
- git
|
||||||
|
- ncdu
|
||||||
|
- ntp
|
||||||
|
- screen
|
||||||
|
- tmux
|
||||||
|
- tree
|
||||||
|
- vim
|
||||||
|
...
|
3
ansible/roles/common/tasks/main.yml
Normal file
3
ansible/roles/common/tasks/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
- include: "{{ ansible_os_family }}"
|
||||||
|
...
|
6
ansible/roles/consul_server/tasks/Debian.yml
Normal file
6
ansible/roles/consul_server/tasks/Debian.yml
Normal 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
|
4
ansible/roles/consul_server/tasks/FreeBSD.yml
Normal file
4
ansible/roles/consul_server/tasks/FreeBSD.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: get consul
|
||||||
|
unarchive:
|
||||||
|
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
|
3
ansible/roles/consul_server/tasks/main.yml
Normal file
3
ansible/roles/consul_server/tasks/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
- include: "{{ ansible_os_family }}"
|
||||||
|
...
|
Loading…
Reference in a new issue