-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update mount points #2092
Update mount points #2092
Conversation
This reverts commit 8a79aba.
This is what I'm seeing in the serial console after trying to deploy a new vm in an existing SRE
|
The symlinks aren't being uploaded as they're actually local symlinks on the deployment system: LOCAL $ ls -alh /Users/jrobinson/Developer/data-safe-haven/code/dsh-upstream/data_safe_haven/resources/workspace/ansible/files/etc/skel/input
lrwxr-xr-x 1 jrobinson staff 10B 6 Aug 13:40 /Users/jrobinson/Developer/data-safe-haven/code/dsh-upstream/data_safe_haven/resources/workspace/ansible/files/etc/skel/input -> /mnt/input WORKSPACE $ ls -alh /var/local/ansible/files/etc/skel
total 2.0K
dr-xr-xr-x 2 root root 0 Aug 6 10:50 .
dr-xr-xr-x 2 root root 0 Aug 6 10:51 ..
-r-xr-xr-x 1 root root 1.3K Aug 6 10:50 bashrc
-r-xr-xr-x 1 root root 14 Aug 6 10:50 xsession |
OK, we can create them another way. |
@jemrobinson Changed in db95c0f |
TASK [Create skeleton symlinks] ************************************************
failed: [localhost] (item={'path': 'etc/skel/input', 'src': '/mnt/input'}) => {"ansible_loop_var": "item", "changed": false, "item": {"path": "etc/skel/input", "src": "/mnt/input"}, "msg": "Error while linking: [Errno 2] No such file or directory: b'/mnt/input' -> b'etc/skel/input'", "path": "etc/skel/input"}
failed: [localhost] (item={'path': 'etc/skel/output', 'src': '/mnt/output'}) => {"ansible_loop_var": "item", "changed": false, "item": {"path": "etc/skel/output", "src": "/mnt/output"}, "msg": "Error while linking: [Errno 2] No such file or directory: b'/mnt/output' -> b'etc/skel/output'", "path": "etc/skel/output"}
failed: [localhost] (item={'path': 'etc/skel/shared', 'src': '/mnt/shared'}) => {"ansible_loop_var": "item", "changed": false, "item": {"path": "etc/skel/shared", "src": "/mnt/shared"}, "msg": "Error while linking: [Errno 2] No such file or directory: b'/mnt/shared' -> b'etc/skel/shared'", "path": "etc/skel/shared"} since the targets do exist $ ls -alh /mnt/
total 8.5K
drwxr-xr-x 5 root root 4.0K Aug 6 12:45 .
drwxr-xr-x 19 root root 4.0K Aug 6 12:56 ..
drwxr-xr-x 2 root root 0 Aug 6 10:58 input
drwxrwxrwx 2 root root 0 Aug 6 10:58 output
drwxrwxrwx 2 root root 64 Aug 6 10:58 shared |
@jemrobinson Paths should be correct in bb47298 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDAP users are not working with these changes:
$ getent passwd
...
saned:x:122:133::/var/lib/saned:/usr/sbin/nologin
colord:x:123:134:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
pulse:x:124:135:PulseAudio daemon,,,:/run/pulse:/usr/sbin/nologin
$ tail -f /var/log/auth.log
Aug 6 13:24:35 shm-pink-sre-fuschia-vm-workspace-02 xrdp-sesman[23082]: pam_unix(xrdp-sesman:account): could not identify user (from getpwnam(james.robinson))
@jemrobinson Interesting, that looks very similar to the problem I had earlier? I'm not sure why that would be, do you have any ideas? |
@jemrobinson @craddm Let's bump this one until after the pen test? |
It's a missing setting in WORKING $ cat /etc/nsswitch.conf
passwd: files systemd ldap
group: files systemd ldap
shadow: files ldap
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis NON-WORKING $ cat /etc/nsswitch.conf
passwd: files systemd
group: files systemd
shadow: files
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis i.e. it's the missing |
That is the next task data-safe-haven/data_safe_haven/resources/workspace/ansible/desired_state.yaml Lines 81 to 85 in bb47298
Did that task run? |
No, because the symlink failed with |
In that case, it might just require running the playbook again (assuming the fatal error is fixed). |
/mnt/shared still failing: ok: [localhost] => (item={'path': '/etc/skel/input', 'src': '/mnt/input'})
ok: [localhost] => (item={'path': '/etc/skel/output', 'src': '/mnt/output'})
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 1] Operation not permitted: b'/mnt/shared'
failed: [localhost] (item={'path': '/etc/skel/shared', 'src': '/mnt/shared'}) => {"ansible_loop_var": "item", "changed": false, "item": {"path": "/etc/skel/shared", "src": "/mnt/shared"}, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1722952769.3476353-37900-21432236129960/AnsiballZ_file.py\", line 102, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1722952769.3476353-37900-21432236129960/AnsiballZ_file.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1722952769.3476353-37900-21432236129960/AnsiballZ_file.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.file', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ansible.builtin.file_payload_apoyxk31/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 928, in <module>\n File \"/tmp/ansible_ansible.builtin.file_payload_apoyxk31/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 916, in main\n File \"/tmp/ansible_ansible.builtin.file_payload_apoyxk31/ansible_ansible.builtin.file_payload.zip/ansible/modules/file.py\", line 771, in ensure_symlink\n File \"/tmp/ansible_ansible.builtin.file_payload_apoyxk31/ansible_ansible.builtin.file_payload.zip/ansible/module_utils/basic.py\", line 1422, in set_fs_attributes_if_different\n File \"/tmp/ansible_ansible.builtin.file_payload_apoyxk31/ansible_ansible.builtin.file_payload.zip/ansible/module_utils/basic.py\", line 1186, in set_mode_if_different\nPermissionError: [Errno 1] Operation not permitted: b'/mnt/shared'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} Can we do this with a script in /etc/profile instead? |
26205ff
to
16491ea
Compare
BUG: Output folder is not writeable $ touch /mnt/output/test.txt
touch: cannot touch 'test.txt': Permission denied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output folder is not writeable for some reason. I can't see why.
If we merge #2103 then we probably don't need the symlinks. If we can drop the symlinks entirely and fix the output folder issue, then we could consider merging this. |
@JimMadge worth coming back to this one after RSECon? |
c0136b6
to
c85090b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Given the previous issues, I'd like to see confirmation that the directories are correctly set up in a from-scratch deploy.
All mount point as in #2027 (comment) Deployment runs without error and the system is functional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JimMadge this looks fine, but can you confirm that it works (and all folders mount correctly) in a from-scratch deployment? I'm not sure why it wasn't working before, so I'd like to be sure.
Co-authored-by: James Robinson <[email protected]>
Yes all was working from a fresh deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM then :)
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
🌂 Related issues
Closes #2027
🔬 Tests