-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yaml
81 lines (70 loc) · 2.17 KB
/
playbook.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
- hosts: 35.238.218.102
become: true
become_user: root
tasks:
- name: Update all packages
ansible.builtin.apt:
update_cache: true
upgrade: "dist"
- name: Install packages
ansible.builtin.package:
name:
- wget
- curl
- btop
- git
- nfs-kernel-server
- fdisk
- python3-venv
- pip
- google-perftools
state: present
- name: Register a variable
ansible.builtin.shell: nvidia-smi
register: driver
ignore_errors: true
- name: Use the variable in conditional statement
ansible.builtin.shell: curl https://raw.githubusercontent.com/GoogleCloudPlatform/compute-gpu-installation/main/linux/install_gpu_driver.py --output install_gpu_driver.py && sudo python3 install_gpu_driver.py
when: driver is failed
- name: Create a new ext4 primary partition
community.general.parted:
device: /dev/nvme0n2
number: 1
state: present
fs_type: "ext4"
- name: Create a ext4 filesystem
community.general.filesystem:
fstype: ext4
dev: /dev/nvme0n2p1
- name: Mount filesystem
ansible.posix.mount:
path: /mnt/ext1
src: /dev/nvme0n2p1
fstype: "ext4"
state: mounted
- name: share in /etc/exports file
ansible.builtin.lineinfile:
path: /etc/exports
state: present
line: '/mnt/ext1 75.4.192.68/32(rw,sync,root_squash)'
notify: restart NFS server
- name: export share
ansible.builtin.command: "exportfs -a"
- name: Clone git repo AUTOMATIC1111
ansible.builtin.git:
repo: https://github.com/AngelGarzaDev/stable-diffusion-webui.git
dest: /mnt/ext1/stable-diffusion-webui
single_branch: yes
version: master
- name: Change file ownership, group and permissions
ansible.builtin.file:
path: /mnt/ext1/stable-diffusion-webui
owner: serveradmin
group: serveradmin
recurse: true
handlers:
- name: restart NFS server
ansible.builtin.service:
name: nfs-server
state: restarted
enabled: true