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

Task reaffirm permission on files not working? #41

Open
mosgjig opened this issue Jan 20, 2023 · 1 comment
Open

Task reaffirm permission on files not working? #41

mosgjig opened this issue Jan 20, 2023 · 1 comment

Comments

@mosgjig
Copy link

mosgjig commented Jan 20, 2023

I'm having an issue where this portion of configure-groups.yml doesn't do what I think it's supposed to do.

- name: reaffirm permission on files
  become: yes
  file:
    path: ~/.kube
    state: directory
    owner: '{{ user }}'
    group: '{{ user }}'
    recurse: yes
  with_items: '{{ users }}'
  loop_control:
    loop_var: user
    label: '{{ user }}'

The playbook to execute the role:

- hosts: cluster
  gather_subset:
    - all_ipv4_addresses

- hosts: cluster
  # serial: 1
  gather_facts: yes
  roles:
    - role: istvano.microk8s
      become: true
      vars:
        users:
          - ubuntu
        microk8s_version: stable
        microk8s_enable_HA: true
        microk8s_group_HA: cluster

Verifying ownership of ~/.kube/config

$ ansible cluster -i inventories/microk8s/hosts -m shell -a "ls -lh ~/.kube/"
pi | CHANGED | rc=0 >>
total 8.0K
drwxr-x--- 4 ubuntu ubuntu 4.0K Jan 18 14:24 cache
-rw-r--r-- 1 root   root   1.9K Jan 20 13:17 config
pi-2 | CHANGED | rc=0 >>
total 4.0K
-rw-r--r-- 1 root root 105 Jan 20 13:18 config
pi-1 | CHANGED | rc=0 >>
total 4.0K
-rw-r--r-- 1 root root 105 Jan 20 13:18 config

One would assume that config would be owned by ubuntu:ubuntu

Any suggestions?

@Dmitriusan
Copy link

@mosgjig , I've opened a pull request that fixes the issue you mentioned #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants