Adding Ansible installation of FAI into Git repo
This commit is contained in:
commit
bc85d9f732
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# ---> Ansible
|
||||
*.retry
|
||||
|
5
faiserver.yml
Normal file
5
faiserver.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: faiserver
|
||||
roles:
|
||||
- common
|
||||
- faiserver
|
3
production
Normal file
3
production
Normal file
@ -0,0 +1,3 @@
|
||||
[faiserver]
|
||||
10.91.1.2
|
||||
|
31
roles/common/tasks/main.yml
Normal file
31
roles/common/tasks/main.yml
Normal 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
|
||||
|
5
roles/faiserver/files/etc/fai/apt/sources.list
Normal file
5
roles/faiserver/files/etc/fai/apt/sources.list
Normal 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
|
||||
|
72
roles/faiserver/tasks/main.yml
Normal file
72
roles/faiserver/tasks/main.yml
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user