Commit b81a0c5c authored by Louis VINCHON's avatar Louis VINCHON
Browse files

Role irods: duplicate the 'centos' tasks for 'ubuntu' and 'debian'

parent 0851f61a
---
- name: Create UNIX iRODS group
group:
name: "{{ irods_unix_group_name }}"
gid: "{{ irods_unix_group_id }}"
state: present
- name: Create UNIX iRODS user
user:
name: "{{ irods_unix_user_name }}"
uid: "{{ irods_unix_user_id }}"
group: irods
state: present
password: "{{irods_unix_password}}"
#password: see docs.ansible.com/ansible/latest/user_module.html
...
---
- name: Template server_config.json file
template:
src: templates/irods_setup.json.j2
dest: /tmp/irods_setup.json
- name: Execute setup_irods.py script
command: /usr/bin/python setup_irods.py --json_configuration_file=/tmp/irods_setup.json
args:
chdir: /var/lib/irods/scripts
creates: /etc/irods/server_config.json
...
---
- import_tasks: group_user.yml
- import_tasks: repos.yml
- import_tasks: packages.yml
- import_tasks: security.yml
- import_tasks: pip.yml
- import_tasks: irods_config.yml
...
---
- name: Install iRODS packages and misc. on CentOS
package:
name:
- libselinux-python
- python-pip
- irods-server-{{ irods_version }}
- irods-database-plugin-postgres-{{ irods_version }}
state: present
when: ansible_facts['distribution'] == "CentOS"
- name: Install iRODS packages and misc. on Ubuntu
package:
name:
- python-apt
- python-pip
- irods-server={{ irods_version }}
- irods-database-plugin-postgres={{ irods_version }}
state: present
when: ansible_facts['distribution'] == "Ubuntu"
...
---
- name: Install python modules
pip:
name:
- pip
- psycopg2-binary
state: latest
...
---
- name: Add key and iRODS repository on CentOS 7
block:
- name: Add key for iRODS repository on CentOS 7
rpm_key:
state: present
key: https://packages.irods.org/irods-signing-key.asc
validate_certs: yes
- name: Add iRODS repository on CentOS 7
yum_repository:
description: RENCI iRODS Repository
name: irods
file: renci-irods.yum
baseurl: https://packages.irods.org/yum/pool/centos$releasever/$basearch
enabled: yes
gpgcheck: no
gpgkey: https://packages.irods.org/irods-signing-key.asc
repo_gpgcheck: no
state: present
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and not use_local_mirror)
- name: Add key and iRODS repository on Debian / Ubuntu
block:
- name: Add key for iRODS repository on Debian / Ubuntu
apt_key:
url: https://packages.irods.org/irods-signing-key.asc
state: present
validate_certs: yes
- name: Add iRODS repository on Ubuntu 18
apt_repository:
repo: "deb [arch=amd64] https://packages.irods.org/apt/ {{ ansible_distribution_release }} main"
state: present
filename: renci-irods
update_cache: true
validate_certs: yes
when: ansible_facts['distribution'] == "Ubuntu"
...
---
- name: Set SELinux mode on CentOS
selinux:
policy: targeted
state: "{{ selinux_mode }}"
when: ansible_facts['distribution'] == "CentOS"
...
---
- name: Create UNIX iRODS group
group:
name: "{{ irods_unix_group_name }}"
gid: "{{ irods_unix_group_id }}"
state: present
- name: Create UNIX iRODS user
user:
name: "{{ irods_unix_user_name }}"
uid: "{{ irods_unix_user_id }}"
group: irods
state: present
password: "{{irods_unix_password}}"
#password: see docs.ansible.com/ansible/latest/user_module.html
...
---
- name: Template server_config.json file
template:
src: templates/irods_setup.json.j2
dest: /tmp/irods_setup.json
- name: Execute setup_irods.py script
command: /usr/bin/python setup_irods.py --json_configuration_file=/tmp/irods_setup.json
args:
chdir: /var/lib/irods/scripts
creates: /etc/irods/server_config.json
...
---
- import_tasks: group_user.yml
- import_tasks: repos.yml
- import_tasks: packages.yml
- import_tasks: security.yml
- import_tasks: pip.yml
- import_tasks: irods_config.yml
...
---
- name: Install iRODS packages and misc. on CentOS
package:
name:
- libselinux-python
- python-pip
- irods-server-{{ irods_version }}
- irods-database-plugin-postgres-{{ irods_version }}
state: present
when: ansible_facts['distribution'] == "CentOS"
- name: Install iRODS packages and misc. on Ubuntu
package:
name:
- python-apt
- python-pip
- irods-server={{ irods_version }}
- irods-database-plugin-postgres={{ irods_version }}
state: present
when: ansible_facts['distribution'] == "Ubuntu"
...
---
- name: Install python modules
pip:
name:
- pip
- psycopg2-binary
state: latest
...
---
- name: Add key and iRODS repository on CentOS 7
block:
- name: Add key for iRODS repository on CentOS 7
rpm_key:
state: present
key: https://packages.irods.org/irods-signing-key.asc
validate_certs: yes
- name: Add iRODS repository on CentOS 7
yum_repository:
description: RENCI iRODS Repository
name: irods
file: renci-irods.yum
baseurl: https://packages.irods.org/yum/pool/centos$releasever/$basearch
enabled: yes
gpgcheck: no
gpgkey: https://packages.irods.org/irods-signing-key.asc
repo_gpgcheck: no
state: present
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and not use_local_mirror)
- name: Add key and iRODS repository on Debian / Ubuntu
block:
- name: Add key for iRODS repository on Debian / Ubuntu
apt_key:
url: https://packages.irods.org/irods-signing-key.asc
state: present
validate_certs: yes
- name: Add iRODS repository on Ubuntu 18
apt_repository:
repo: "deb [arch=amd64] https://packages.irods.org/apt/ {{ ansible_distribution_release }} main"
state: present
filename: renci-irods
update_cache: true
validate_certs: yes
when: ansible_facts['distribution'] == "Ubuntu"
...
---
- name: Set SELinux mode on CentOS
selinux:
policy: targeted
state: "{{ selinux_mode }}"
when: ansible_facts['distribution'] == "CentOS"
...
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