Skip to content

Need to add become: root to ubuntu.yml? #8

@toastedcrumpets

Description

@toastedcrumpets

First, thank you for a wonderful ansible role, just trying out deploying it now.
Installing longhorn to a single-node remote Ubuntu 22.04 server with microk8s I had some issues. In particular I needed to modify
tasks/ubuntu.yml to add become: yes to the multipathd tasks, otherwise I have permission errors.

- name: Ensure multipathd conf.d directory
  become: yes
  ansible.builtin.file:
    path: "{{ longhorn_multipathd_blacklist_directory }}"
    state: directory
    mode: "{{ longhorn_multipathd_blacklist_directory_perm }}"
    owner: "root"
    group: "root"

- name: Ensure multipathd blacklist for Longhorn
  become: yes
  when:
    - longhorn_multipathd_blacklist_directory
    - longhorn_multipathd_blacklist_file
  ansible.builtin.copy:
    src: "files/{{ longhorn_multipathd_blacklist_directory }}/{{ longhorn_multipathd_blacklist_file }}"
    dest: "/{{ longhorn_multipathd_blacklist_directory }}/{{ longhorn_multipathd_blacklist_file }}"
    mode: "{{ longhorn_multipathd_blacklist_file_perm }}"
    owner: "root"
    group: "root"
  notify:
    - restart multipathd

If I try adding become: yes to when the role is invoked, then I get other issues as my root user doesn't have a kubeconf setup.

Can you suggest the best way to handle permissions for the multipath? Is this something needed more generally?
Thank you again for all your hard work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions