Commit be58ddb2 authored by viscapi's avatar viscapi
Browse files

Turned iRODS role into Galaxy role. Solves John's #2 issue on iRODS chat

parent bda4fddf
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
---
# defaults file for irods
---
# handlers file for irods
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
---
- 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: Check that iRODS hasn't been configured before
stat:
path: /etc/irods/server_config.json
register: config
- 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
when: config.stat.exists == False
...
---
- 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.
yum:
conf_file: '/etc/yum.conf'
name:
- libselinux-python
- python-pip
- irods-server-{{ irods_version }}
- irods-database-plugin-postgres-{{ irods_version }}
state: present
...
---
- name: Install python modules
pip:
name:
- pip
- psycopg2-binary
state: latest
...
---
- name: Add key for iRODS repository
rpm_key:
state: present
key: https://packages.irods.org/irods-signing-key.asc
validate_certs: yes
- name: Add iRODS repository
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
...
---
- name: Set SELinux mode
selinux:
policy: targeted
state: "{{ selinux_mode }}"
...
{
"admin_password": "{{ admin_password }}",
"service_account_environment": {
"irods_host": "{{ ansible_fqdn }}",
"irods_port": 1247,
"irods_user_name": "rods",
"irods_zone_name": "{{ irods_zone }}",
"irods_client_server_negotiation": "request_server_negotiation",
"irods_client_server_policy": "CS_NEG_REFUSE",
"irods_cwd": "/{{ irods_zone }}/home/rods",
"irods_default_hash_scheme": "SHA256",
"irods_default_resource": "{{ default_resource }}",
"irods_encryption_algorithm": "AES-256-CBC",
"irods_encryption_key_size": 32,
"irods_encryption_salt_size": 32,
"irods_encryption_num_hash_rounds": 16,
"irods_home": "/{{ irods_zone }}/home/rods",
"irods_match_hash_policy": "compatible"
},
"host_access_control_config": {
"access_entries": []
},
"hosts_config": {
"host_entries": []
},
"host_system_information": {
"service_account_user_name": "{{ irods_unix_user_name }}",
"service_account_group_name": "{{ irods_unix_group_name }}"
},
"server_config": {
"advanced_settings": {
"default_log_rotation_in_days": 5,
"default_number_of_transfer_threads": 4,
"default_temporary_password_lifetime_in_seconds": 120,
"maximum_number_of_concurrent_rule_engine_server_processes": 4,
"maximum_size_for_single_buffer_in_megabytes": 32,
"maximum_temporary_password_lifetime_in_seconds": 1000,
"rule_engine_server_execution_time_in_seconds": 120,
"rule_engine_server_sleep_time_in_seconds": 30,
"transfer_buffer_size_for_parallel_transfer_in_megabytes": 4,
"transfer_chunk_size_for_parallel_transfer_in_megabytes": 40
},
"catalog_provider_hosts": [
{% if irods_server_mode == "provider" %}
"{{ ansible_fqdn }}"
{% elif irods_server_mode == "consumer" %}
"{{ provider_hostname }}"
{% endif %}
],
"catalog_service_role": "{{ irods_server_mode }}",
"default_dir_mode": "0750",
"default_file_mode": "0600",
"default_hash_scheme": "SHA256",
{% if irods_server_mode == "provider" %}
"default_resource_name": "{{ default_resource }}",
{% elif irods_server_mode == "consumer" %}
"default_resource_name": "{{ inventory_hostname_short }}Resource",
{% endif %}
"environment_variables": {},
"federation": [],
"match_hash_policy": "compatible",
"negotiation_key": "{{ negotiation_key }}",
"plugin_configuration": {
"authentication": {},
"database": {
"postgres": {
"db_host": "{{ database_hostname }}",
"db_name": "{{ database_name }}",
"db_odbc_driver": "PostgreSQL",
"db_password": "{{ database_password }}",
"db_port": 5432,
"db_username": "{{ database_user }}"
}
},
"network": {},
"resource": {},
"rule_engines": [
{
"instance_name": "irods_rule_engine_plugin-irods_rule_language-instance",
"plugin_name": "irods_rule_engine_plugin-irods_rule_language",
"plugin_specific_configuration": {
"re_data_variable_mapping_set": [
"core"
],
"re_function_name_mapping_set": [
"core"
],
"re_rulebase_set": [
"core"
],
"regexes_for_supported_peps": [
"ac[^ ]*",
"msi[^ ]*",
"[^ ]*pep_[^ ]*_(pre|post)"
]
},
"shared_memory_instance": "irods_rule_language_rule_engine"
},
{
"instance_name": "irods_rule_engine_plugin-cpp_default_policy-instance",
"plugin_name": "irods_rule_engine_plugin-cpp_default_policy",
"plugin_specific_configuration": {}
}
]
},
"rule_engine_namespaces": [
""
],
"schema_name": "server_config",
"schema_validation_base_uri": "file:///var/lib/irods/configuration_schemas",
"schema_version": "v3",
"server_control_plane_encryption_algorithm": "AES-256-CBC",
"server_control_plane_encryption_num_hash_rounds": 16,
"server_control_plane_key": "{{ server_control_plane_key }}",
"server_control_plane_port": 1248,
"server_control_plane_timeout_milliseconds": 10000,
"server_port_range_end": 20199,
"server_port_range_start": 20000,
"xmsg_port": 1279,
"zone_auth_scheme": "native",
"zone_key": "{{ zone_key }}",
"zone_name": "{{ irods_zone }}",
"zone_port": 1247,
"zone_user": "rods"
}
}
---
- hosts: localhost
remote_user: root
roles:
- irods
---
# vars file for irods
Supports Markdown
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