<commit_before>---
# after bootstrap0.yml has run
# run this with ansible-playbook bootstrap1.yml --extra-vars "geli_passphrase=XXX"
# this configures the crypto zpool

- hosts: jails_host
  remote_user: root

  handlers:
    - name: restart ezjail
      service: name=ezjail state=restarted

  tasks:
  - name: create tank partitions
    command: "gpart add -t freebsd-zfs -l {{ zpool_name }}-{{ item }} {{ item }} creates=/dev/gpt/{{ zpool_name }}-{{ item }}"
    with_items: root_devices 

  - name: create temporary GELI passphrase file
    copy: content={{ geli_passphrase }} dest={{ geli_passphrase_location }} owner=root mode=600
    tags: mount_geli

  - name: create GELI providers
    command: "geli init -s 4096 -l 256 -J {{ geli_passphrase_location}} /dev/gpt/{{ zpool_name }}-{{ item }} creates=/var/backups/gpt_{{ zpool_name }}-{{ item }}.eli"
    with_items: root_devices

  - name: mount the GELI containers
    command: "geli attach -j {{ geli_passphrase_location}} /dev/gpt/{{ zpool_name }}-{{ item }} creates=/dev/gpt/{{ zpool_name }}-{{ item }}.eli"
    with_items: root_devices
    tags: mount_geli
    notify:
      - restart ezjail

  - name: remove passphrase from FS
    file: path={{ geli_passphrase_location }} state=absent<commit_msg>make sure that all (jail) zfs systems are mounted after a restart<commit_after>---
# after bootstrap0.yml has run
# run this with ansible-playbook bootstrap1.yml --extra-vars "geli_passphrase=XXX"
# this configures the crypto zpool

- hosts: jails_host
  remote_user: root

  handlers:
    - name: restart ezjail
      service: name=ezjail state=restarted

  tasks:
  - name: create tank partitions
    command: "gpart add -t freebsd-zfs -l {{ zpool_name }}-{{ item }} {{ item }} creates=/dev/gpt/{{ zpool_name }}-{{ item }}"
    with_items: root_devices 

  - name: create temporary GELI passphrase file
    copy: content={{ geli_passphrase }} dest={{ geli_passphrase_location }} owner=root mode=600
    tags: mount_geli

  - name: create GELI providers
    command: "geli init -s 4096 -l 256 -J {{ geli_passphrase_location}} /dev/gpt/{{ zpool_name }}-{{ item }} creates=/var/backups/gpt_{{ zpool_name }}-{{ item }}.eli"
    with_items: root_devices

  - name: mount the GELI containers
    command: "geli attach -j {{ geli_passphrase_location}} /dev/gpt/{{ zpool_name }}-{{ item }} creates=/dev/gpt/{{ zpool_name }}-{{ item }}.eli"
    with_items: root_devices
    tags: mount_geli
    notify:
      - restart ezjail

  - name: force mount all ZFS
    command: "zfs mount -a"
    tags: mount_geli

  - name: remove passphrase from FS
    file: path={{ geli_passphrase_location }} state=absent
{'fraction_non_alphanumeric': 0.12914156626506024, 'fraction_numerical': 0.009036144578313253, 'mean_word_length': 3.5110356536502545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6519066', 'n_tokens_mistral': 946, 'n_tokens_neox': 896, 'n_words': 255}