Skip to content
Snippets Groups Projects

use variables instead of hardcoded values

Merged Fabio Santaniello requested to merge use_variables into master
3 files
+ 246
29
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 13
14
@@ -4,7 +4,6 @@
- name: "Check if {{ dev }} exists"
stat:
path: "{{ dev }}"
register: hdd2
- name: install parted
become: yes
@@ -14,30 +13,30 @@
- parted.x86_64
- parted-devel.x86_64
- name: Unmount a mounted /home
- name: Unmount a mounted folder
ansible.posix.mount:
path: /home
path: "{{ mount }}"
state: unmounted
ignore_errors: yes
- name: Create a ext4 filesystem on /dev/nvme0n1
- name: Create a filesystem on device
community.general.filesystem:
fstype: ext4
dev: /dev/nvme0n1
fstype: "{{ fstype }}"
dev: "{{ dev }}"
force: yes
- name: Mount up device by /dev/nvme0n1 on /home in fstab
- name: Mount up device on folder in fstab
mount:
path: /home
src: /dev/nvme0n1
fstype: ext4
path: "{{ mount }}"
src: "{{ dev }}"
fstype: "{{ fstype }}"
state: present
- name: Remount a mounted volume /home
- name: Remount a mounted volume
ansible.posix.mount:
path: /home
src: /dev/nvme0n1
fstype: ext4
path: "{{ mount }}"
src: "{{ dev }}"
fstype: "{{ fstype }}"
state: mounted
Loading