Compare commits

...

5 commits

Author SHA1 Message Date
Vasiliy Gokoyev
73123bb6b5
Merge d032d13083 into d36a289deb 2024-04-05 23:14:26 +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
Vasiliy Gokoyev
d032d13083
fix a CI linter issue 2024-01-10 09:55:50 -05:00
k3it
12ecc3823b maintain proper formating of the remote paths when defined as user@host:/... or host:/...
fixes #360
2022-05-14 15:16:03 -04:00
3 changed files with 15 additions and 3 deletions

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

@ -77,7 +77,14 @@ class ActionModule(ActionBase):
if self._host_is_ipv6_address(host): if self._host_is_ipv6_address(host):
return '[%s%s]:%s' % (user_prefix, host, path) return '[%s%s]:%s' % (user_prefix, host, path)
return '%s%s:%s' % (user_prefix, host, path)
# preserve formatting of remote paths if host or user@host is explicitly defined in the path
if ':' not in path:
return '%s%s:%s' % (user_prefix, host, path)
elif '@' not in path:
return '%s%s' % (user_prefix, path)
else:
return path
def _process_origin(self, host, path, user): def _process_origin(self, host, path, user):

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: