Compare commits

...

7 commits

Author SHA1 Message Date
copyrights
b6d30f8b30
Merge f392e407f9 into d36a289deb 2024-04-05 23:14:32 +01:00
softwarefactory-project-zuul[bot]
d36a289deb
Merge pull request #490 from atom4git/main
Docs/authorized_key: clarify that the path key should probably NOT be set

SUMMARY

Docs: Fixed unclearance in documentation connected wirh relative path
Added additional description in documentation.

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

authorized_key.py
ADDITIONAL INFORMATION

Clarify the documentation unclearance in connected with relative path ~/.ssh/authorized_keys
The purpose of the pull request is to eliminate ambiguities in the documentation.
In our case, when using the ~ sign, we get the user's root directory (although we explicitly specify a different username)
Here is the issue and full picture of problem which we want to fix: LINK

Closese:  #483

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: atom4git
Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-04-02 08:44:34 +00:00
Sergey
60c8d23c7f
Docs/authorized_key: clarify that the path key should probably NOT be set 2024-04-02 17:08:28 +09:00
Adam Miller
f392e407f9
Merge branch 'main' into last_wins 2024-01-10 08:41:00 -06:00
copyrights
c77c592fc6 add changelog fragment 2022-05-24 07:10:54 +02:00
copyrights
02006a1e7f add mount boot test 2022-05-23 22:52:38 +02:00
copyrights
1512495dd7 mount: remove boot exception if defaults in opts 2022-05-23 22:21:11 +02:00
5 changed files with 31 additions and 7 deletions

View file

@ -0,0 +1,3 @@
---
bugfix:
- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364).

View file

@ -0,0 +1,3 @@
---
bugfixes:
- "Bugfix in the documentation regarding the path option for authorised_key(https://github.com/ansible-collections/ansible.posix/issues/483)."

View file

@ -28,8 +28,10 @@ options:
required: true required: true
path: path:
description: description:
- Alternate path to the authorized_keys file. - Alternative path to the authorized_keys file.
- When unset, this value defaults to I(~/.ssh/authorized_keys). - The default value is the C(.ssh/authorized_keys) of the home of the user specified in the O(user) parameter.
- Most of the time, it's not necessary to set this key.
- Use the path to your target authorized_keys if you need to explicitly point on it.
type: path type: path
manage_dir: manage_dir:
description: description:

View file

@ -840,11 +840,8 @@ def main():
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.") args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
elif not module.params['boot']: elif not module.params['boot']:
args['boot'] = 'no' args['boot'] = 'no'
if 'defaults' in opts: opts.append('noauto')
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'defaults'.") args['opts'] = ','.join(opts)
else:
opts.append('noauto')
args['opts'] = ','.join(opts)
# If fstab file does not exist, we first need to create it. This mainly # If fstab file does not exist, we first need to create it. This mainly
# happens when fstab option is passed to the module. # happens when fstab option is passed to the module.

View file

@ -467,6 +467,25 @@
that: that:
- mount_info['opts'] == 'rw,user,async,noauto' - mount_info['opts'] == 'rw,user,async,noauto'
- name: Unmount FS
ansible.posix.mount:
path: /tmp/myfs
state: absent
- name: Mount the FS with noauto option and defaults
ansible.posix.mount:
path: /tmp/myfs
src: /tmp/myfs.img
fstype: ext3
state: mounted
boot: no
register: mount_info
- name: Assert the mount without noauto was successful
ansible.builtin.assert:
that:
- "'noauto' in mount_info['opts'].split(',')"
- name: Unmount FS - name: Unmount FS
ansible.posix.mount: ansible.posix.mount:
path: /tmp/myfs path: /tmp/myfs