Add FOG server role

This commit is contained in:
2026-04-23 01:04:01 -04:00
parent 7b24236e92
commit 0aa62d6af9
3 changed files with 61 additions and 0 deletions

8
dev/fog.yml Normal file
View File

@@ -0,0 +1,8 @@
- name: Install FRITA FOG Server
hosts: all
become: true
vars_files:
- vars/fog.yml
roles:
- common
- fog

0
dev/vars/fog.yml Normal file
View File

53
roles/fog/tasks/main.yml Normal file
View File

@@ -0,0 +1,53 @@
- name: Check if FOG is already installed
ansible.builtin.stat:
path: /opt/fog/.fogsettings
register: fog_installed
- name: Upgrade system before FOG server install
ansible.builtin.dnf:
name: "*"
state: latest # noqa: package-latest
when: not fog_installed.stat.exists
- name: Install git
ansible.builtin.dnf:
name: git
state: present
- name: Set SELinux to permissive and make it persistent
ansible.posix.selinux:
policy: targeted
state: permissive
- name: Ensure parent source directory exists
ansible.builtin.file:
path: /usr/local/src
state: directory
mode: "0755"
- name: Clone FOG stable branch
ansible.builtin.git:
repo: https://github.com/FOGProject/fogproject.git
dest: /usr/local/src/fogproject
version: stable
update: true
- name: Run FOG installer first time
ansible.builtin.command: ./installfog.sh -Y
args:
chdir: /usr/local/src/fogproject/bin
creates: /opt/fog/.fogsettings
- name: Allow required FOG firewall ports
ansible.posix.firewalld:
port: "{{ item }}"
permanent: true
immediate: true
state: enabled
loop:
- 80/tcp
- 69/udp
- 111/tcp
- 111/udp
- 2049/tcp
- 2049/udp