Skip to content
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

Set promtail user home to install directory #138

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

hafu
Copy link
Contributor

@hafu hafu commented Nov 25, 2022

This PR sets the home directory of the promtail user to the promtail_install_dir (/opt/promtail).

When reverting the installation with ansible a / as home could lead to the deletion of the whole system when using ansible.builtin.user module with:

# revert promtail installation …
- name: "Remove promtail"
  #

  vars:
    #
    promtail_system_user: promtail

  tasks:
    #
    - name: "Remove promtail user"
      ansible.builtin.user:
        name: "{{ promtail_system_user }}"
        state: absent
        remove: true  # defaults: false
        force: true   # defaults: false
    #

This may be a edge case, since ansible defaults are safe. But setting the home to a safer location prevents from deleting the whole root.

@patrickjahns patrickjahns added the semver:patch Change leading to a patch level version bump label Nov 25, 2022
@patrickjahns
Copy link
Owner

Thank you for the contribution 🚀

@patrickjahns patrickjahns merged commit 5dedc57 into patrickjahns:master Nov 25, 2022
@github-actions github-actions bot mentioned this pull request Nov 25, 2022
@shinebayar-g
Copy link

This is a regression! See #140

@shinebayar-g
Copy link

In fact, is home really needed? Since we already have createhome: False. I don't know why it's needed at all.

@hafu
Copy link
Contributor Author

hafu commented Nov 26, 2022

In fact, is home really needed? Since we already have createhome: False. I don't know why it's needed at all.

This is a good point. The home parameter in the Ansible user module is optional. Would be interesting to what it will be set on new installations. I guess /home/promtail. On existing installations it won't be touched. Sounds like a good solution. I will check this the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch Change leading to a patch level version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants