-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.yml
69 lines (64 loc) · 2.15 KB
/
install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
- name: Bootstrap Archlinux
hosts: localhost
connection: local
become: yes
vars_files:
- "host_vars/{{ machine_aliases[ansible_product_name] }}"
vars_prompt:
- name: luks_passphrase
prompt: "encryption passphrase (blank for no encryption):"
private: yes
confirm: yes
roles:
- { role: init_disks, tags: ['init-disks'] }
- { role: arch-bootstrap, tags: ['bootstrap'] }
- { role: finalize-install, tags: ['finalize-install'], when: luks_passphrase|length > 0 }
- name: Install base system
connection: chroot
hosts: chroot
vars_files:
- "host_vars/{{ machine_aliases[ansible_product_name] }}"
vars_prompt:
- name: root_password
prompt: "root password:"
encrypt: "sha512_crypt"
private: yes
confirm: yes
- name: user_password
prompt: "user password:"
encrypt: "sha512_crypt"
private: yes
confirm: yes
roles:
- { role: base, tags: ['base'] }
- { role: user, tags: ['user'] }
- { role: aur, tags: ['aur'] }
- { role: dotfiles, tags: ['user'] }
- { role: locales, tags: ['locales'] }
- { role: microcode, tags: ['microcode'], when: "'GenuineIntel' in ansible_processor" }
- { role: thinkpad, tags: ['thinkpad'], when: "'ThinkPad' in ansible_product_version" }
- { role: initramfs, tags: ['initramfs'] }
- { role: networkmanager, tags: ['networkmanager'], when: static_ip is not defined }
- { role: system_tools, tags: ['system_tools'] }
- { role: grub, tags: ['grub'], when: bootloader == 'grub' }
- name: Finish installation
hosts: localhost
connection: local
vars_files:
- "host_vars/{{ machine_aliases[ansible_product_name] }}"
tasks:
- name: unmount partitions with the new system
command: umount -Rf {{ arch_root }}
- name: unmount swap
command: swapoff -a
- name: close LUKS encrypted devices
luks_device:
device: "/dev/disk/by-id/{{ item.0.device_id }}-part{{ item.1.number }}"
state: closed
when: item.1.encrypt is defined and item.1.encrypt
with_subelements:
- "{{ sata_drives }}"
- partitions
# - name: reboot
# command: reboot