NFS mount for container templates
This commit is contained in:
parent
49a1dc59c2
commit
d442ac232e
@ -124,13 +124,20 @@
|
|||||||
path: /mnt/iso-images/template/iso
|
path: /mnt/iso-images/template/iso
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Ensure Container Templates mount point directory exists in sjc001
|
||||||
|
when: "'sjc001' in ansible_host"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /mnt/container-templates/cache
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: Insert/update NFS mount block in /etc/fstab in sjc001
|
- name: Insert/update NFS mount block in /etc/fstab in sjc001
|
||||||
when: "'sjc001' in inventory_hostname"
|
when: "'sjc001' in ansible_host"
|
||||||
notify: reload fstab
|
notify: reload fstab
|
||||||
ansible.builtin.blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/fstab
|
path: /etc/fstab
|
||||||
block: |
|
block: |
|
||||||
nas001.sjc001.fritzlab.net:/mnt/main/iso /mnt/iso-images/template/iso nfs4 rw 0 0
|
nas001.sjc001.fritzlab.net:/mnt/main/iso /mnt/iso-images/template/iso nfs4 rw 0 0
|
||||||
|
nas001.sjc001.fritzlab.net:/mnt/main/container-templates /mnt/container-templates/cache nfs4 rw 0 0
|
||||||
marker: "# {mark} ANSIBLE MANAGED BLOCK for NFS mounts"
|
marker: "# {mark} ANSIBLE MANAGED BLOCK for NFS mounts"
|
||||||
backup: yes
|
backup: yes
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
debian_version: "bookworm"
|
debian_version: "bookworm"
|
||||||
lxc_name: "fritzlab-base"
|
lxc_name: "fritzlab-base"
|
||||||
lxc_image_artifact_name: "{{ lxc_name }}-{{ timestamp }}.tar.gz"
|
lxc_image_artifact_name: "{{ lxc_name }}-{{ timestamp }}.tar.gz"
|
||||||
lxc_base_dir: "/var/lib/lxc"
|
lxc_build_dir: "/tmp/build_{{ lxc_name }}_{{ timestamp }}"
|
||||||
lxc_template_dir: "/var/lib/vz/template/cache"
|
lxc_template_dir: "/mnt/container-templates/cache"
|
||||||
working_lxc_dir: "{{ lxc_base_dir }}/{{ lxc_name }}"
|
working_lxc_dir: "{{ lxc_build_dir }}/{{ lxc_name }}"
|
||||||
working_rootfs_dir: "{{ working_lxc_dir }}/rootfs"
|
working_rootfs_dir: "{{ working_lxc_dir }}/rootfs"
|
||||||
working_chroot: "chroot {{ working_rootfs_dir }}"
|
working_chroot: "chroot {{ working_rootfs_dir }}"
|
||||||
lxc_unnecessary_units:
|
lxc_unnecessary_units:
|
||||||
@ -156,7 +156,7 @@
|
|||||||
args:
|
args:
|
||||||
creates: /tmp/{{ lxc_image_artifact_name }}
|
creates: /tmp/{{ lxc_image_artifact_name }}
|
||||||
|
|
||||||
- name: Move artifact to destination on host
|
- name: Move artifact to NFS Share
|
||||||
command:
|
command:
|
||||||
cmd: "mv /tmp/{{ lxc_image_artifact_name }} {{ lxc_template_dir }}"
|
cmd: "mv /tmp/{{ lxc_image_artifact_name }} {{ lxc_template_dir }}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user