style 💎: Update LXC container setup command
Updated the pct create command to include ssh-public-keys and features, ensuring consistency with other setup commands.
This commit is contained in:
@@ -50,22 +50,23 @@
|
|||||||
|
|
||||||
- name: Create LXC container {{ container_hostname }} with id {{ container_id }} using pct command on shell
|
- name: Create LXC container {{ container_hostname }} with id {{ container_id }} using pct command on shell
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
|
set -e
|
||||||
pct create {{ container_id }} {{ container_template }} \
|
pct create {{ container_id }} {{ container_template }} \
|
||||||
-ostype {{ container_ostype }} \
|
-ostype {{ container_ostype }} \
|
||||||
-hostname {{ container_hostname }} \
|
-hostname {{ container_hostname }} \
|
||||||
-password "{{ container_password }}" \
|
-password "{{ container_password }}" \
|
||||||
-ssh-public-keys {{ ssh_keys_file }} \
|
-ssh-public-keys "{{ ssh_keys_file }}" \
|
||||||
-cores {{ container_cores }} \
|
-cores {{ container_cores }} \
|
||||||
-memory {{ container_memory }} \
|
-memory {{ container_memory }} \
|
||||||
-swap {{ container_swap }} \
|
-swap {{ container_swap }} \
|
||||||
-net0 {{container_net}} \
|
-net0 "{{container_net}}" \
|
||||||
-storage {{ container_storage }} \
|
-storage {{ container_storage }} \
|
||||||
-description "{{ container_description }}" \
|
-description "{{ container_description }}" \
|
||||||
-onboot {{ container_onboot }} \
|
-onboot {{ container_onboot }} \
|
||||||
-protection {{ container_protection }} \
|
-protection {{ container_protection }} \
|
||||||
-unprivileged {{ container_unprivileged }} \
|
-unprivileged {{ container_unprivileged }} \
|
||||||
-tags "{{ container_tags | join(',') }}" \
|
-tags "{{ container_tags | join(',') }}" \
|
||||||
-features {{ container_features }}
|
-features "{{ container_features }}"
|
||||||
args:
|
args:
|
||||||
creates: "/etc/pve/lxc/{{ container_id }}.conf"
|
creates: "/etc/pve/lxc/{{ container_id }}.conf"
|
||||||
no_log: false
|
no_log: false
|
||||||
|
|||||||
Reference in New Issue
Block a user