From 55528a942ae4d4a927d083aac6190da1e717634f Mon Sep 17 00:00:00 2001 From: Julian Gethmann Date: Thu, 16 Mar 2017 16:34:02 +0100 Subject: [PATCH] Add MAD-8 role * Install MAD-8 from repo and fix issue with madpath and madbin-path --- hosts | 4 ++++ mad8.yml | 3 +++ roles/mad8/tasks/mad8.yml | 25 +++++++++++++++++++++++++ roles/mad8/tasks/main.yml | 3 +++ roles/mad8/tasks/yumrepos.yml | 21 +++++++++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 mad8.yml create mode 100644 roles/mad8/tasks/mad8.yml create mode 100644 roles/mad8/tasks/main.yml create mode 100644 roles/mad8/tasks/yumrepos.yml diff --git a/hosts b/hosts index 3491061..de5b50a 100644 --- a/hosts +++ b/hosts @@ -22,6 +22,10 @@ las117.las.kit.edu las126.las.kit.edu las-gethmann.las.kit.edu +[mad8] +las113.las.kit.edu +las-gethmann.las.kit.edu + [lab] las93.las.kit.edu diff --git a/mad8.yml b/mad8.yml new file mode 100644 index 0000000..a7ff654 --- /dev/null +++ b/mad8.yml @@ -0,0 +1,3 @@ +- hosts: mad8 + roles: + - mad8 diff --git a/roles/mad8/tasks/mad8.yml b/roles/mad8/tasks/mad8.yml new file mode 100644 index 0000000..9aca16b --- /dev/null +++ b/roles/mad8/tasks/mad8.yml @@ -0,0 +1,25 @@ +--- +- name: install MAD-8 + dnf: + name: "{{ item }}" + state: installed + become: yes + with_items: + - "MAD-8" + when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS") + +- name: Work around for dict issue 1/2 + lineinfile: + line: 'set madpath="/usr/share"' + regexp: 'set madpath=".*"' + dest: /usr/bin/mad + backup: yes + become: yes + +- name: Work around for dict issue 2/2 + lineinfile: + line: 'set madbin="/usr/bin"' + regexp: 'set madbin=".*"' + dest: /usr/bin/mad + backup: yes + become: yes diff --git a/roles/mad8/tasks/main.yml b/roles/mad8/tasks/main.yml new file mode 100644 index 0000000..0131114 --- /dev/null +++ b/roles/mad8/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include: yumrepos.yml +- include: mad8.yml diff --git a/roles/mad8/tasks/yumrepos.yml b/roles/mad8/tasks/yumrepos.yml new file mode 100644 index 0000000..af9bf91 --- /dev/null +++ b/roles/mad8/tasks/yumrepos.yml @@ -0,0 +1,21 @@ +--- +- name: download SSL-Cert + shell: echo -n |openssl s_client -connect las101.las.kit.edu:443 -showcerts |sed -n '/^-----BEGIN CERT/,/^-----END CERT/p' > /etc/pki/ca-trust/source/anchors/las101.pem + args: + creates: /etc/pki/ca-trust/source/anchors/las101.pem + become: yes + notify: update-ca-trust + when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS") + +- name: Add LAS i386 dnf repository + yum_repository: + name: lasrepo-nonfree-i386 + description: Laboratory for Applications of Synchrotron radiation (CS) i386 + baseurl: "https://las101.las.kit.edu/lasrepo/${releasever}/i386/" + enabled: yes + gpgcheck: no + keepalive: yes + keepcache: 0 + sslcacert: /etc/pki/ca-trust/source/anchors/las101.pem + become: yes + when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS") -- GitLab