updated README, added tags, fixed knownhosts, added cron mount
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
state: present
|
||||
ssh_keys: "{{ ssh_keys }}"
|
||||
# FIXME: https://github.com/ansible-collections/hetzner.hcloud/issues/585
|
||||
#volumes: "{{ storage.home.name }}"
|
||||
#volumes: "{{ storage.volume.name }}"
|
||||
register: server
|
||||
|
||||
- name: Attach the home volume
|
||||
hetzner.hcloud.volume:
|
||||
name: "{{ storage.home.name }}"
|
||||
name: "{{ storage.volume.name }}"
|
||||
server: "{{ hostname }}"
|
||||
state: present
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Remove volume
|
||||
hetzner.hcloud.volume:
|
||||
name: "{{ storage.home.name }}"
|
||||
name: "{{ storage.volume.name }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove server
|
||||
|
||||
@@ -4,13 +4,20 @@
|
||||
state: present
|
||||
name: "{{ packages }}"
|
||||
|
||||
# FIXME: remove the symlink in the release snapshot
|
||||
# FIXME: remove the symlink in the next release snapshot
|
||||
- name: Remove old home sym link
|
||||
shell: |
|
||||
rm /home
|
||||
touch /tmp/.ansible.home
|
||||
args:
|
||||
creates: "/tmp/.ansible.home"
|
||||
|
||||
- name: Remove original cron tab dir
|
||||
shell: |
|
||||
rm -rf /var/cron/tabs
|
||||
touch /tmp/.ansible.crontabs
|
||||
args:
|
||||
creates: "/tmp/.ansible.crontabs"
|
||||
|
||||
- name: Setup home volume partition
|
||||
shell: |
|
||||
@@ -20,17 +27,20 @@
|
||||
creates: "/tmp/.ansible.gpt"
|
||||
|
||||
- name: Setup home fs type
|
||||
shell: "gpart add -t freebsd-zfs -l {{ storage.home.name }} -a 1M {{ storage.home.device }}"
|
||||
shell: |
|
||||
gpart add -t freebsd-zfs -l {{ storage.volume.name }} -a 1M {{ storage.volume.device }}
|
||||
touch /tmp/.ansible.add
|
||||
args:
|
||||
creates: "/dev/da1p1"
|
||||
creates: "/tmp/.ansible.add"
|
||||
|
||||
|
||||
- name: Create zpool using home volume
|
||||
shell: "zpool create -f {{ storage.home.name }} {{ storage.home.device }}"
|
||||
shell: "zpool create -f {{ storage.volume.name }} {{ storage.volume.device }}"
|
||||
args:
|
||||
creates: "/{{ storage.home.name }}"
|
||||
creates: "/{{ storage.volume.name }}"
|
||||
|
||||
- name: Create zfs home dataset
|
||||
shell: "zfs create -o mountpoint={{ storage.home.mount }} {{ storage.home.name }}/home"
|
||||
loop: "{{ storage.mounts }}"
|
||||
shell: "zfs create -o mountpoint={{ item.mount }} {{ storage.volume.name }}{{ item.name }}"
|
||||
args:
|
||||
creates: "/home"
|
||||
creates: "{{ item.mount }}"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Create the home volume
|
||||
hetzner.hcloud.volume:
|
||||
name: "{{ storage.home.name }}"
|
||||
name: "{{ storage.volume.name }}"
|
||||
location: "{{ location }}"
|
||||
size: "{{ storage.home.size }}"
|
||||
size: "{{ storage.volume.size }}"
|
||||
state: present
|
||||
|
||||
Reference in New Issue
Block a user