Skip to content

Commit

Permalink
Merge pull request #33 from ls1intum/feature/make-ssh-clone-configurable
Browse files Browse the repository at this point in the history
Make ssh clone configurable
  • Loading branch information
Mtze authored Mar 8, 2023
2 parents 5565203 + 4f3d57b commit 15f593a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exclude_paths:
skip_list:
- '403' # Package installs should not use latest
- '208' # File permissions unset or incorrect
- '602' # Allow empty string comparison
- no-tabs
- 'ignore-errors'
- 'no-changed-when'
Expand Down
3 changes: 3 additions & 0 deletions roles/artemis/tasks/artemis_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
path: "{{ artemis_ssh_key_path }}"
state: directory
mode: '0775'
when: artemis_ssh_key_path is not none and artemis_ssh_key_path != ""

- name: Copy ssh key
become: true
Expand All @@ -74,6 +75,7 @@
dest: "{{ artemis_ssh_key_path }}/{{ artemis_ssh_key_name }}"
register: ssh_key
notify: restart artemis
when: artemis_ssh_key_path is not none and artemis_ssh_key_path != ""

- name: Set permissions for artemis ssh key directory
become: true
Expand All @@ -83,6 +85,7 @@
recurse: yes
owner: "{{ artemis_user_name }}"
group: "{{ artemis_user_group }}"
when: artemis_ssh_key_path is not none and artemis_ssh_key_path != ""

- name: Copy artemis.service systemd configuration
become: true
Expand Down
4 changes: 3 additions & 1 deletion roles/artemis/templates/application-prod.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ artemis:
token: {{ version_control.bitbucket.token }}
ssh-template-clone-url: {{ version_control.bitbucket.ssh_url }}
ssh-keys-url-path: /plugins/servlet/ssh/account/keys
{% if artemis_ssh_key_path is defined and artemis_ssh_key_path is not none and artemis_ssh_key_path != "" %}
ssh-private-key-folder-path: {{ artemis_ssh_key_path }}
{% if artemis_ssh_key_password is defined and artemis_ssh_key_password is not none %}
{% endif %}
{% if artemis_ssh_key_password is defined and artemis_ssh_key_password is not none and artemis_ssh_key_password != "" %}
ssh-private-key-password: {{ artemis_ssh_key_password }}
{% endif %}
{% endif %}
Expand Down

0 comments on commit 15f593a

Please sign in to comment.