Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor icommands and add tests #110

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions molecule/playbook-icommands/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
provisioner:
name: ansible
env:
components:
- name: icommands
path: icommands.yml
7 changes: 7 additions & 0 deletions molecule/playbook-icommands/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Run icommand
ansible.builtin.command: ihelp
3 changes: 1 addition & 2 deletions playbooks/roles/irods_icommands/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---

- name: install icommands
- name: Install icommands
package:
name: irods-icommands
state: present

3 changes: 1 addition & 2 deletions playbooks/roles/irods_repo/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
irods_repo_yum_major_version: "{{ ansible_distribution_major_version }}"
irods_repo_apt_release: "{{ ansible_distribution_release }}"
irods_repo_url: "https://packages.irods.org"


irods_key_location: "/usr/share/keyrings/irods.asc"
24 changes: 9 additions & 15 deletions playbooks/roles/irods_repo/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
---
# adds iRODS repository, method depends on distro

- name: enable iRODS repository, yum package manager
- name: Enable iRODS repository, yum package manager
yum_repository:
name: iRODS
description: RENCI iRODS Repository
baseurl: '{{ irods_repo_url }}/yum/pool/centos{{ irods_repo_yum_major_version }}/{{ ansible_architecture }}'
gpgkey: '{{ irods_repo_url }}/irods-signing-key.asc'
gpgcheck: yes
gpgcheck: true
when: ansible_pkg_mgr == 'yum'

- name: run apt update
apt:
update_cache: yes
cache_valid_time: 3600
- name: Download irods key
ansible.builtin.get_url:
url: "{{ irods_repo_url }}/irods-signing-key.asc"
dest: "{{ irods_key_location }}"
when: ansible_pkg_mgr == 'apt'

- name: add iRODS repository apt-key
apt_key:
url: '{{ irods_repo_url }}/irods-signing-key.asc'
state: present
when: ansible_pkg_mgr == 'apt'

- name: add iRODS repository for apt package manager
- name: Add iRODS repository for apt package manager
apt_repository:
repo: 'deb {{ irods_repo_url }}/apt/ {{ irods_repo_apt_release }} main'
repo: "deb [signed-by={{ irods_key_location }}] {{ irods_repo_url }}/apt/ {{ ansible_distribution_release }} main"
state: present
filename: renci-irods
update_cache: yes
update_cache: true
when: ansible_pkg_mgr == 'apt'
28 changes: 13 additions & 15 deletions playbooks/roles/irods_skel/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
---
- name: add .irods to new user skeleton
file:
path: /etc/skel/.irods
state: directory
mode: '0755'

- name: create default irods_environment.json in skel
template:
src: irods_environment.json.j2
dest: /etc/skel/.irods/irods_environment.json
owner: root
group: root
mode: '0600'


- name: Add .irods to new user skeleton
file:
path: /etc/skel/.irods
state: directory
mode: '0755'

- name: Create default irods_environment.json in skel
template:
src: irods_environment.json.j2
dest: /etc/skel/.irods/irods_environment.json
owner: root
group: root
mode: '0600'
force: false # don't overwrite if an environment file already exists (due to e.g. another component)
Loading