Skip to content

Commit

Permalink
roles robotuser and sshfs: use specific skip tags for mount operations
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Oct 31, 2024
1 parent 03fffad commit 25a1c72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/robotuser/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ provisioner:
prepare: ./prepare.yml
env:
ANSIBLE_ROLES_PATH: ../../../
ANSIBLE_SKIP_TAGS: mount, molecule-notest
role_name_check: 1
2 changes: 1 addition & 1 deletion playbooks/roles/sshfs_cleanup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
state: unmounted

- name: Cleanup robotuser
tags: molecule-notest
tags: mount
user:
name: "{{ robotuser_name }}"
state: absent
Expand Down
3 changes: 2 additions & 1 deletion playbooks/roles/sshfs_mount/tasks/mount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- name: Mount remote filesystem using credentials of robot user
become_user: "{{ sshfs_connection_info.username }}"
become: "{{ item.become }}"
when: "'molecule-notest' not in ansible_skip_tags or item.state == 'present'" # don't actually mount when running in container
tags: mount
when: item.state == 'present'" # don't actually mount when running in container
mount:
src: "sshfs#{{ sshfs_connection_info.username }}@{{ sshfs_connection_info.server }}:{{ sshfs_connection_info.sourcepath }}"
path: "{{ sshfs_connection_info.mountpoint }}"
Expand Down

0 comments on commit 25a1c72

Please sign in to comment.