chore 📦: Update setupacdc.yml to combine SSH public keys into one file
Updated the setupacdc.yml configuration to combine SSH public keys into a single file, improving security and organization. This change simplifies the process of managing SSH keys for LXC containers.
This commit is contained in:
@@ -32,13 +32,22 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- name: Combine SSH public keys into one file
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: "{{ ssh_keys_file }}"
|
||||||
|
content: |
|
||||||
|
{% for key in ssh_public_keys %}
|
||||||
|
{{ key }}
|
||||||
|
{% endfor %}
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
- 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: |
|
||||||
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 "{{ container_pubkey }}" \
|
-ssh-public-keys {{ ssh_keys_file }} \
|
||||||
-cores {{ container_cores }} \
|
-cores {{ container_cores }} \
|
||||||
-memory {{ container_memory }} \
|
-memory {{ container_memory }} \
|
||||||
-swap {{ container_swap }} \
|
-swap {{ container_swap }} \
|
||||||
|
|||||||
Reference in New Issue
Block a user