Skip to content

Commit ade3772

Browse files
committed
new: Ansible installation playbook
1 parent 3cf1bde commit ade3772

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

ansible/inventory.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[myhosts]
2+
lacus.local

ansible/playbook_install.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
- name: Check reachable
2+
hosts: myhosts
3+
tasks:
4+
- name: Ping my hosts
5+
ansible.builtin.ping:
6+
7+
- name: Install system dependencies
8+
hosts: myhosts
9+
become: true
10+
become_method: sudo
11+
tasks:
12+
- name: Install general dependencies
13+
ansible.builtin.apt:
14+
pkg:
15+
- build-essential
16+
- git
17+
- python3-venv
18+
- pipx
19+
- acl
20+
- ffmpeg
21+
- libavcodec-extra
22+
23+
- name: Install Playwright system dependency (needs sudo)
24+
hosts: myhosts
25+
tasks:
26+
- name: Update PATH for pipx / poetry
27+
ansible.builtin.command: pipx ensurepath
28+
29+
- name: Install Playwright
30+
community.general.pipx:
31+
name: playwright
32+
33+
- name: Install system deps
34+
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/playwright install-deps"
35+
36+
- name: Create Users
37+
hosts: myhosts
38+
become: true
39+
become_method: sudo
40+
tasks:
41+
- name: Create a user 'lacus' with a home directory
42+
ansible.builtin.user:
43+
name: lacus
44+
create_home: true
45+
shell: /bin/bash
46+
47+
- name: Install Lacus
48+
hosts: myhosts
49+
become: true
50+
become_method: sudo
51+
become_user: lacus
52+
vars:
53+
allow_world_readable_tmpfiles: true
54+
tasks:
55+
56+
- name: Update PATH for pipx / poetry
57+
ansible.builtin.command: pipx ensurepath
58+
59+
- name: Install poetry
60+
community.general.pipx:
61+
name: poetry
62+
63+
- name: Install poetry shell
64+
ansible.builtin.command: pipx inject poetry poetry-plugin-shell
65+
66+
- name: Upgrade poetry
67+
community.general.pipx:
68+
name: poetry
69+
state: upgrade
70+
include_injected: true
71+
72+
- name: Clone Valkey
73+
ansible.builtin.git:
74+
repo: https://github.com/valkey-io/valkey.git
75+
dest: "{{ ansible_env.HOME }}/valkey"
76+
version: 8.0
77+
78+
- name: Build Valkey
79+
ansible.builtin.command: make -j2
80+
args:
81+
chdir: "{{ ansible_env.HOME }}/valkey"
82+
83+
84+
- name: Clone Lacus
85+
ansible.builtin.git:
86+
repo: https://github.com/ail-project/lacus.git
87+
dest: "{{ ansible_env.HOME }}/lacus"
88+
89+
- name: Install Lacus
90+
ansible.builtin.command: "poetry install"
91+
environment:
92+
PATH: "{{ ansible_env.PATH }}:{{ ansible_env.HOME }}/.local/bin"
93+
args:
94+
chdir: "{{ ansible_env.HOME }}/lacus"
95+
96+
- name: Init .env file
97+
ansible.builtin.copy:
98+
content: "LACUS_HOME='/home/lacus/lacus'"
99+
dest: "{{ ansible_env.HOME }}/lacus/.env"
100+
101+
- name: Update lacus
102+
ansible.builtin.command: "poetry run update --init"
103+
environment:
104+
PATH: "{{ ansible_env.PATH }}:{{ ansible_env.HOME }}/.local/bin"
105+
args:
106+
chdir: "{{ ansible_env.HOME }}/lacus"
107+

0 commit comments

Comments
 (0)