-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from DarkAssassin23/master
Added support for more distros
- Loading branch information
Showing
7 changed files
with
116 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: Update pacman cache. | ||
community.general.pacman: | ||
update_cache: true | ||
become: true | ||
|
||
- name: Install dependencies. | ||
ansible.builtin.package: | ||
name: | ||
- base-devel | ||
- gcc-fortran | ||
state: present | ||
become: true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- name: Update apt cache. | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
become: true | ||
|
||
- name: Install dependencies. | ||
ansible.builtin.package: | ||
name: | ||
- build-essential | ||
- gfortran | ||
- automake | ||
state: present | ||
become: true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Update dnf cache. | ||
ansible.builtin.dnf: | ||
update_cache: true | ||
become: true | ||
|
||
- name: Install dependencies. | ||
ansible.builtin.package: | ||
name: | ||
- '@Development Tools' | ||
- gcc-gfortran | ||
# Fedora, at least Fedora Server, doesn't install this | ||
# with the Development Tools group for some reason | ||
- gcc-g++ | ||
state: present | ||
become: true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- name: Creating new custom firewall zone. | ||
ansible.posix.firewalld: | ||
zone: top500 | ||
permanent: true | ||
state: present | ||
become: true | ||
|
||
- name: Setting custom firewall zone to accept connections. | ||
ansible.posix.firewalld: | ||
zone: top500 | ||
target: ACCEPT | ||
state: enabled | ||
permanent: true | ||
become: true | ||
|
||
- name: Adding nodes as trusted sources in the firewall. | ||
ansible.posix.firewalld: | ||
source: "{{ item }}" | ||
zone: top500 | ||
state: enabled | ||
permanent: true | ||
loop: "{{ host_ips }}" | ||
when: item != ansible_default_ipv4.address | ||
become: true | ||
|
||
- name: Restarting firewall for changes to take effect. | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: restarted | ||
become: true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Remove our custom firewall zone since we don't need it anymore | ||
- name: Reverting firewall back to its original state. | ||
ansible.posix.firewalld: | ||
zone: top500 | ||
state: absent | ||
permanent: true | ||
become: true | ||
|
||
- name: Restarting firewall for changes to take effect. | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: restarted | ||
become: true | ||
|
||
# When removing a custom firewall zone, a .xml.old file will sometimes remain | ||
- name: Cleaning up firewall rules. | ||
ansible.builtin.file: | ||
path: /etc/firewalld/zones/top500.xml.old | ||
state: absent | ||
become: true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters