Skip to content

Commit

Permalink
Merge pull request #348 from deNBI/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
dweinholz authored Oct 6, 2023
2 parents 326c3d9 + 6660076 commit 285cdb6
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
- uses: actions/checkout@v4

- name: Run ansible-lint
uses: ansible-community/ansible-lint-action@v6.16.0
uses: ansible-community/ansible-lint-action@v6.17.0
10 changes: 5 additions & 5 deletions conda/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@

- name: Add conda-forge channel
become_user: "{{ conda_vars.default_user }}"
shell: timeout 1m bash -c 'source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels conda-forge'
ansible.builtin.shell: timeout 1m bash -c 'source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels conda-forge'
args:
executable: /bin/bash

- name: Add anaconda channel
become_user: "{{ conda_vars.default_user }}"
shell: timeout 1m bash -c 'source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels anaconda'
ansible.builtin.shell: timeout 1m bash -c 'source {{conda_vars.CONDA_DIR}}/bin/activate && conda config --add channels anaconda'
args:
executable: /bin/bash

- name: Init .bashrc for conda
become_user: "{{ conda_vars.default_user }}"
shell: timeout 1m bash -c 'source {{ conda_vars.CONDA_DIR}}/bin/activate && conda init'
ansible.builtin.shell: timeout 1m bash -c 'source {{ conda_vars.CONDA_DIR}}/bin/activate && conda init'
args:
executable: /bin/bash

Expand All @@ -52,15 +52,15 @@

- name: Check for installed packages
become_user: "{{ conda_vars.default_user }}"
shell: 'source {{ conda_vars.CONDA_DIR }}/bin/activate && conda activate {{ conda_vars.ENV_NAME|quote }} && conda list'
ansible.builtin.shell: 'source {{ conda_vars.CONDA_DIR }}/bin/activate && conda activate {{ conda_vars.ENV_NAME|quote }} && conda list'
register: added_packages
args:
executable: /bin/bash


- name: Install chosen packages
become_user: "{{ conda_vars.default_user }}"
shell: 'source {{ conda_vars.CONDA_DIR }}/bin/activate && conda activate {{ conda_vars.ENV_NAME|quote }}
ansible.builtin.shell: 'source {{ conda_vars.CONDA_DIR }}/bin/activate && conda activate {{ conda_vars.ENV_NAME|quote }}
&& conda install --yes {{ item.key }}={{ item.value.version }}'
args:
executable: /bin/bash
Expand Down
2 changes: 1 addition & 1 deletion emgb/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ services:
restart: always

targetdb:
restart: always
restart: always
12 changes: 5 additions & 7 deletions emgb/emgb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Ensure python-is-python3 is installed
become: yes
become: true
package:
name: python-is-python3
state: present
Expand All @@ -19,7 +19,7 @@
BINARY="yq_linux_amd64" # Change this if you need a different binary
wget "https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz" -O - |\
tar xz && mv "${BINARY}" /usr/bin/yq
become: yes
become: true

- name: Clone EMGB Repo
git:
Expand All @@ -43,11 +43,11 @@
cmd: ./prepare-import.sh
args:
chdir: "{{ emgb_vars.repo_path }}"

- name: Copy docker-compose.override
ansible.builtin.copy:
src: docker-compose.override.yml
dest: "{{emgb_vars.repo_path}}"
dest: "{{ emgb_vars.repo_path }}"

- name: Run yq command to delete nginx ports
ansible.builtin.command:
Expand All @@ -59,6 +59,4 @@
ansible.builtin.command:
cmd: docker-compose up -d
args:
chdir: "{{emgb_vars.repo_path}}"


chdir: "{{ emgb_vars.repo_path }}"
1 change: 0 additions & 1 deletion emgb/emgb_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ community_driven: true
wiki_link: ""
information_for_display:
version: 1.6.0

1 change: 1 addition & 0 deletions guacamole/roles/guacamole/tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: localhost
name: Test
remote_user: root
roles:
- guacamolerdp-ansible
12 changes: 6 additions & 6 deletions jupyterlab/jupyterlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,40 @@

- name: Adjust miniconda folder rights
become: true
shell: chown -R {{jupyterlab_vars.default_user}}:{{jupyterlab_vars.default_user}} {{jupyterlab_vars.CONDA_DIR}}/
ansible.builtin.shell: chown -R {{jupyterlab_vars.default_user}}:{{jupyterlab_vars.default_user}} {{jupyterlab_vars.CONDA_DIR}}/
when: not jupyterlab_vars.create_only_backend

- name: Add bioconda channel
become_user: "{{ jupyterlab_vars.default_user }}"
shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels bioconda'
ansible.builtin.shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels bioconda'
args:
executable: /bin/bash
when: not jupyterlab_vars.create_only_backend

- name: Add conda-forge channel
become_user: "{{ jupyterlab_vars.default_user }}"
shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels conda-forge'
ansible.builtin.shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels conda-forge'
args:
executable: /bin/bash
when: not jupyterlab_vars.create_only_backend

- name: Add anaconda channel
become_user: "{{ jupyterlab_vars.default_user }}"
shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels anaconda'
ansible.builtin.shell: timeout 1m bash -c 'source {{jupyterlab_vars.CONDA_DIR}}/bin/activate && conda config --add channels anaconda'
args:
executable: /bin/bash
when: not jupyterlab_vars.create_only_backend

- name: Init .bashrc for conda
become_user: "{{ jupyterlab_vars.default_user }}"
shell: timeout 1m bash -c 'source {{ jupyterlab_vars.CONDA_DIR}}/bin/activate && conda init'
ansible.builtin.shell: timeout 1m bash -c 'source {{ jupyterlab_vars.CONDA_DIR}}/bin/activate && conda init'
args:
executable: /bin/bash
when: not jupyterlab_vars.create_only_backend

- name: Create alias for environment
become_user: "{{ jupyterlab_vars.default_user }}"
shell: echo $ALIAS_VARIABLE > ~/.bash_aliases
ansible.builtin.shell: echo $ALIAS_VARIABLE > ~/.bash_aliases
environment:
ALIAS_VARIABLE: alias {{ jupyterlab_vars.ENV_NAME| quote }}="conda activate {{ jupyterlab_vars.ENV_NAME| quote }}"
when: not jupyterlab_vars.create_only_backend
Expand Down
16 changes: 7 additions & 9 deletions packer/cleanup_base_cluster_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
when: keep is defined and keep | int > 0

- name: Retrieve list of all master base image
shell: >
ansible.builtin.shell: >
openstack image list
--private
--tag "base_cluster"
Expand All @@ -26,13 +26,12 @@
--sort created_at:desc
-f json
register: ubuntu_master_images_command
changed_when: false

- name: Set master image fact
set_fact:
ansible.builtin.set_fact:
ubuntu_master_images: "{{ ubuntu_master_images_command.stdout }}"



- name: Echo Ubuntu images length
ansible.builtin.debug:
var: ubuntu_master_images | length
Expand All @@ -49,10 +48,10 @@
loop: "{{ ubuntu_master_images }}"
loop_control:
index_var: index
when: ubuntu_master_images | length > limit | int and index >= limit | int
when: ubuntu_master_images | length > limit | int and index >= limit | int

- name: Retrieve list of all worker base image
shell: >
ansible.builtin.shell: >
openstack image list
--tag "base_cluster"
--tag "cluster"
Expand All @@ -63,13 +62,12 @@
--sort created_at:desc
-f json
register: ubuntu_worker_images_command
changed_when: false

- name: Set worker image fact
set_fact:
ansible.builtin.set_fact:
ubuntu_worker_images: "{{ ubuntu_worker_images_command.stdout }}"



- name: Echo Ubuntu images length
ansible.builtin.debug:
var: ubuntu_worker_images | length
Expand Down
4 changes: 2 additions & 2 deletions packer/cleanup_base_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
when: keep is defined and keep | int > 0

- name: Retrieve list of all images
shell: >
ansible.builtin.shell: >
openstack image list
--private
--tag "base_image"
Expand All @@ -23,7 +23,7 @@
--sort created_at:desc
-f json
register: ubuntu_images_command

changed_when: false

- name: Set image fact
ansible.builtin.set_fact:
Expand Down
25 changes: 14 additions & 11 deletions packer/cleanup_resenvs_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
limit: "{{ keep | int }}"
when: keep is defined and keep | int > 0

- name: Retrieve list of all {{resenv}} base image
shell: >
- name: Retrieve list of all {{ resenv }} base image
ansible.builtin.shell: >
openstack image list
--private
--tag {{vars[resenv + '_tag']}}
--tag {{ vars[resenv + '_tag'] }}
--property image_type=image
--property os_version={{ os_version }}
--property os_distro={{ os_distro }}
--sort created_at:desc
--long
-f json
register: resenv_images_command
changed_when: false


- name: Filter images excluding "cluster" tag
set_fact:
resenv_images: "{{ resenv_images_command.stdout|from_json | rejectattr('Tags', 'search', 'cluster')}}"
ansible.builtin.set_fact:
resenv_images: "{{ resenv_images_command.stdout | from_json | rejectattr('Tags', 'search', 'cluster') }}"

- name: Echo Ubuntu images length
ansible.builtin.debug:
Expand All @@ -49,11 +50,11 @@
index_var: index
when: resenv_images | length > limit | int and index >= limit | int

- name: Retrieve list of all {{resenv}} base image
shell: >
- name: Retrieve list of all {{ resenv }} base image
ansible.builtin.shell: >
openstack image list
--private
--tag {{vars[resenv + '_tag']}}
--tag {{ vars[resenv + '_tag'] }}
--tag cluster
--tag master
--property image_type=image
Expand All @@ -63,6 +64,7 @@
--long
-f json
register: resenv_master_images_command
changed_when: false

- name: Set image fact
ansible.builtin.set_fact:
Expand All @@ -87,11 +89,11 @@
when: resenv_master_images | length > limit | int and index >= limit | int


- name: Retrieve list of all {{resenv}} base image
shell: >
- name: Retrieve list of all {{ resenv }} base image
ansible.builtin.shell: >
openstack image list
--private
--tag {{vars[resenv + '_tag']}}
--tag {{ vars[resenv + '_tag'] }}
--tag cluster
--tag worker
--property image_type=image
Expand All @@ -101,6 +103,7 @@
--long
-f json
register: resenv_worker_images_command
changed_when: false

- name: Set image fact
ansible.builtin.set_fact:
Expand Down
2 changes: 1 addition & 1 deletion packer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

openstacksdk==1.5.0
ansible==6.7.0
python-openstackclient==6.2.0
python-openstackclient==6.3.0
paramiko
2 changes: 1 addition & 1 deletion packer/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ roles:

- name: autoscaling
src: https://github.com/deNBI/autoscaling-ansible
version: 1.1.7
version: 1.1.8

- name: geerlingguy.swap

Expand Down
2 changes: 1 addition & 1 deletion packer/update_base_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@


- name: Delete local uploaded file
file:
ansible.builtin.file:
path: "{{ name }}"
state: absent
when: update
6 changes: 3 additions & 3 deletions theiaide/theiaide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
theia_ide_workspace: ${HOME}

- name: Install nvm
shell: |
ansible.builtin.shell: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | NVM_DIR={{ theiaide_vars.NVM_INSTALL_DIR }} /bin/bash
args:
creates: "{{ theiaide_vars.NVM_INSTALL_DIR }}/nvm.sh"

- name: Install node 12 and yarn
shell: |
ansible.builtin.shell: |
source {{ theiaide_vars.NVM_INSTALL_DIR }}/nvm.sh
nvm install 12
npm install -g yarn
args:
executable: bash

- name: Install prebuild theia
shell: |
ansible.builtin.shell: |
curl -o- https://bibiserv.cebitec.uni-bielefeld.de/resources/bibigrid/plugins/theia-ide_node12.tar.gz | tar -xzf -
args:
chdir: /opt
Expand Down

0 comments on commit 285cdb6

Please sign in to comment.