Adding Ansible installation of FAI into Git repo

This commit is contained in:
Jakub Filo 2019-11-02 19:21:52 +00:00
commit bc85d9f732
7 changed files with 124 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# ---> Ansible
*.retry

5
faiserver.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: faiserver
roles:
- common
- faiserver

3
production Normal file
View File

@ -0,0 +1,3 @@
[faiserver]
10.91.1.2

View File

@ -0,0 +1,31 @@
---
- name: Install common packages
apt:
state: latest
pkg:
- vim
- htop
- bash-completion
- pciutils
- usbutils
- postfix
- wget
- curl
- unbound
- ca-certificates
install_recommends: no
force_apt_get: yes
become: yes
- name: Purge unwanted packages
apt:
state: absent
purge: yes
autoremove: yes
pkg:
- nano
- exim4-base
install_recommends: no
force_apt_get: yes
become: yes

View File

@ -0,0 +1,5 @@
# These lines should work for many sites
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security buster/updates main

View File

@ -0,0 +1,72 @@
---
- name: Add FAI apt key
apt_key:
id: B11EE3273F6B2DEB528C93DA2BF8D9FE074BCDE4
state: present
url: https://fai-project.org/download/2BF8D9FE074BCDE4.asc
become: yes
- name: Add FAI apt repository
apt_repository:
state: present
repo: deb http://fai-project.org/download buster koeln
filename: fai
update_cache: yes
become: yes
- name: Install FAI via apt
apt:
state: latest
name: fai-server
install_recommends: yes
force_apt_get: yes
become: yes
- name: Define packages installed in NFSROOT
blockinfile:
state: present
path: /etc/fai/NFSROOT
backup: yes
marker: "# {mark}"
marker_begin: "BEGIN MANAGED BY PLANTROON"
marker_end: "END MANAGED BY PLANTROON"
insertafter: '^PACKAGES install-norec FULL'
block: |
cryptsetup
become: yes
# THIS DOES NOT WORK DUE TO BUGS IN FAI/DRACUT
# NFS SERVER MUST BE THE SAME AS DHCP SERVER
# IF SPECIFIED HERE, FAI BUGS OUt
# HOLY FUCK
# FAI SUCKS
# I LOST IT
#- name: Use nfsroot= with IP
# blockinfile:
# state: present
# path: /etc/fai/nfsroot.conf
- name: Some FAI configuration
copy:
src: etc/fai/apt/sources.list
dest: /etc/fai/apt/sources.list
force: yes
mode: preserve
become: yes
#- name: Setup/rebuild FAI NFSROOT
# shell: fai-setup -v -f
# become: yes
#- name: Setup/rebuild FAI debmirror
# shell: fai-mirror -v /srv/debmirror
# become: yes
- name: Copy FAI config space
copy:
src: config/
dest: /srv/fai/config/
force: yes
mode: preserve
become: yes

5
site.yml Normal file
View File

@ -0,0 +1,5 @@
---
# file: site.yml
- import_playbook: faiserver.yml