main
earnest ma 2022-01-23 21:43:00 -05:00
parent 01beed91ec
commit 8b3cb74e8f
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
12 changed files with 88 additions and 0 deletions

22
README.md Normal file
View File

@ -0,0 +1,22 @@
# ansible
Currently Ansible configurations for `ataraxia`, although if this goes well I'll bring it to Tycho/future devices. Please don't use :/
## Start
`sudo dnf install -y ansible`
- inventory: hosts file
- tasks: what playbook is going to do
- variables
- group_vars: groups of hosts
- host_vars: individual hosts
- `ansible-vault create/edit secret.yml`
- playbook: list of all tasks/roles Ansible must execute
- execute: `ansible-playbook run.yml -K --ask-vault-pass`
## S
```bash
ansible-galaxy collection install ansible.posix
```

3
ansible.cfg Normal file
View File

@ -0,0 +1,3 @@
[defaults]
inventory = hosts
transport = local

1
hosts Normal file
View File

@ -0,0 +1 @@
localhost

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,6 @@
---
- include_vars:
file: "{{ ansible_hostname }}.yml"
- include: selinux.yml
- include: packages.yml
- include: users.yml

View File

@ -0,0 +1,29 @@
---
# - name: Configure repos
- name: Install essential packages
package:
name: "{{ packages }}"
state: latest
vars:
packages:
- htop
- neovim
- tmux
- zsh
# Hostname-specific package tasks
- include: hosts/{{ ansible_hostname }}.yml
- name: Install zoom
when: use_zoom | default(False)
dnf:
name: 'https://zoom.us/client/latest/zoom_x86_64.rpm'
disable_gpg_check: true
state: present
#- name: Install hostname-specific packages
# package:
# name: "{{ extra_packages }}"
# state: latest

View File

@ -0,0 +1,5 @@
---
- name: Set SELinux to permissive mode
ansible.posix.selinux:
policy: targeted
state: permissive

View File

@ -0,0 +1 @@

7
run.yml Normal file
View File

@ -0,0 +1,7 @@
---
- hosts: all
become: yes
roles:
- common
# tasks:
# - import_tasks: tasks/essential.yml

8
tasks/essential.yml Normal file
View File

@ -0,0 +1,8 @@
- name: Install essential packages
package:
name: "{{ packages }}"
state: latest
# extra conf
- include: hosts/{{ ansible_hostname }}.yaml

View File

@ -0,0 +1,4 @@
- name: Update packages
dnf:
name: "*"
state: latest

1
vars/ataraxia.yml Normal file
View File

@ -0,0 +1 @@
use_zoom: true