Commit a16daf10 authored by Ryan Taylor's avatar Ryan Taylor

Merge branch '20200421-config' into 'master'

new config

Closes #3

See merge request !1
parents 9517e4fd 41934ca9
terraform/.terraform/
terraform/terraform.tfstate
terraform/.terraform.tfstate.lock.info
terraform/terraform.tfstate.backup
......@@ -2,7 +2,7 @@
# Set up a management node to run FAHControl and monitor the clients.
- hosts: controller
- hosts: fahcontrol
roles:
- folding-controller
become: yes
......
......@@ -19,4 +19,3 @@ fah_manager: ""
apply_updates: "false"
timezone: "America/Vancouver"
---
# A handler doesn't work well here because we don't want to reload
# at the end, after it was already stopped and started.
- name: Configure FAHClient
# A handler doesn't work well for these config changes because
# we don't want to reload at the end again, after it was already stopped and started.
# Slot config goes here
- name: Configure FAHClient (/etc/fahclient/config.xml)
template:
src: "config.xml.j2"
dest: "/etc/fahclient/config.xml"
owner: fahclient
group: root
mode: 0644
register: fah_config
register: fah_xmlconfig
# Otherwise as much config as possible goes here
- name: Configure FAHClient (/etc/default/fahclient)
template:
src: "fahclient.j2"
dest: "/etc/default/fahclient"
owner: root
group: root
mode: 0644
register: fah_defconfig
# FIXME: use of 'pattern' is a workaround in these sysvinit tasks
# Remove after https://github.com/ansible/ansible/pull/68472
......@@ -20,7 +33,6 @@
pattern: "/usr/bin/FAHClient"
register: fah_running_check
check_mode: yes
changed_when: no
# If it was already running, we need this to apply config change
- name: Reload FAHClient if configuration changed
......@@ -29,7 +41,7 @@
state: "reloaded"
pattern: "/usr/bin/FAHClient"
when:
- fah_config.changed
- fah_xmlconfig.changed or fah_defconfig.changed
- not fah_running_check.changed
- name: Ensure FAHClient is enabled and running
......
......@@ -3,7 +3,7 @@
# download from https://foldingathome.org/start-folding/
- name: Install FAHClient
yum:
name: https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v7.5/fahclient-7.5.1-1.x86_64.rpm
name: https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v7.6/fahclient-7.6.9-1.x86_64.rpm
state: present
validate_certs: yes
when: ansible_facts.packages['fahclient'] is not defined
......
......@@ -9,7 +9,7 @@
- name: set timezone
timezone:
name: "{{ timezone }}"
name: "UTC"
- { import_tasks: storage.yml, tags: ['storage'] }
- { import_tasks: update.yml, tags: ['update'], when: apply_updates|bool }
......
{#
Note: FAHClient parses and re-writes the config file,
Note: FAHClient parses and re-writes the config file (?),
so we try to match what it will write to maintain idempotence.
Also see: /usr/share/doc/fahclient/sample-config.xml
#}
<config>
<!-- Client Control -->
<idle-seconds v='0'/>
<!-- Folding Slot Configuration -->
<client-type v='advanced'/>
<max-packet-size v='big'/>
<!-- HTTP Server -->
<allow v='127.0.0.1 {{ fah_manager }}'/>
<!-- Remote Command Server -->
<password v='{{ fah_adminpass }}'/>
<!-- Slot Control -->
<power v='full'/>
{% if 'gpu_nodes' in group_names %}
<smp v='true'/>
{% if 'meta-terrafold_group_gpu_nodes' in group_names %}
<gpu v='true'/>
{% endif %}
<!-- User Information -->
{% if fah_passkey is defined %}
<passkey v='{{ fah_passkey }}'/>
{% endif %}
<team v='{{ fah_team }}'/>
<user v='{{ fah_user }}'/>
<!-- Folding Slots -->
<slot id='0' type='CPU'/>
{% if 'gpu_nodes' in group_names %}
{% if 'meta-terrafold_group_gpu_nodes' in group_names %}
<slot id='1' type='GPU'/>
{% endif %}
</config>
\ No newline at end of file
EXTRA_OPTS="--user={{ fah_user }} --team={{ fah_team }} {% if fah_passkey is defined %}--passkey={{ fah_passkey }}{% endif %} \
--password={{ fah_adminpass }} --allow=127.0.0.1,{{ fah_manager }} \
{{ fah_other_options|default('') }}"
......@@ -3,8 +3,8 @@
- name: Install packages
yum:
name:
- https://download.foldingathome.org/releases/public/release/fahcontrol/centos-6.7-64bit/v7.5/fahcontrol-7.5.1-1.noarch.rpm
- https://download.foldingathome.org/releases/public/release/fahviewer/centos-6.7-64bit/v7.5/fahviewer-7.5.1-1.x86_64.rpm
- https://download.foldingathome.org/releases/public/release/fahcontrol/centos-6.7-64bit/v7.6/fahcontrol-7.6.9-1.noarch.rpm
- https://download.foldingathome.org/releases/public/release/fahviewer/centos-6.7-64bit/v7.6/fahviewer-7.6.9-1.x86_64.rpm
- xorg-x11-xauth
- mesa-dri-drivers
......
{% for node in groups['cpu_nodes'] | union(groups['gpu_nodes']) %}
{{ hostvars[node].inventory_hostname }},{{ hostvars[node].ansible_host }}
{% for node in groups['meta-terrafold_group_cpu_nodes'] | union(groups['meta-terrafold_group_gpu_nodes']) %}
{{ hostvars[node].inventory_hostname }},{{ hostvars[node].openstack.private_v4 }}
{% endfor %}
---
# For initial image configuration.
# extra setup for GPU nodes if applicable
#- hosts: template
# roles:
# - nvidia-gpu-setup
# become: yes
# become_user: root
# TODO Need to remove the initial slot config from config.xml so that
# slot auto config (incl. for GPUs) works
- hosts: template
roles:
- folding-client
vars:
apply_updates: true
become: yes
become_user: root
......@@ -3,13 +3,13 @@
# Configure CPU and GPU compute nodes to run FAHClient.
# extra setup for GPU nodes if applicable
- hosts: gpu_nodes
- hosts: meta-terrafold_group_gpu_nodes
roles:
- nvidia-gpu-setup
become: yes
become_user: root
- hosts: cpu_nodes:gpu_nodes
- hosts: meta-terrafold_group_gpu_nodes:meta-terrafold_group_cpu_nodes
roles:
- folding-client
become: yes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment