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

Duplicates in Create per_profile snippets directories #13

Open
btravouillon opened this issue Apr 30, 2023 · 0 comments
Open

Duplicates in Create per_profile snippets directories #13

btravouillon opened this issue Apr 30, 2023 · 0 comments

Comments

@btravouillon
Copy link
Collaborator

btravouillon commented Apr 30, 2023

When several profiles share the same snippets name (like partition or custom_post_install), the task creates the directories for each profile.

ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/custom_post_install)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)
ok: [cobbler] => (item=Create directory /var/lib/cobbler/snippets/per_profile/partition)

- name: Create per_profile snippets directories
ansible.builtin.file:
path: "/var/lib/cobbler/snippets/per_profile/{{ item.1.name }}"
state: directory
owner: root
group: root
mode: '0755'
loop: "{{ cobbler_profiles | subelements('snippets', skip_missing=True) }}"
loop_control:
label: "Create directory /var/lib/cobbler/snippets/per_profile/{{ item.1.name }}"

Running the task once per directory is enough.

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

1 participant