Ansible Setup » History » Version 21
Jon Goldberg, 05/11/2022 02:41 PM
1 | 18 | Jon Goldberg | {{last_updated_at}} by {{last_updated_by}} |
---|---|---|---|
2 | |||
3 | 1 | Jon Goldberg | # Ansible Setup |
4 | |||
5 | 13 | Jon Goldberg | Ansible setup is now done through Ansible itself plus a short bootstrap script. Please check earlier revisions of this page for manual setup. |
6 | 1 | Jon Goldberg | |
7 | 13 | Jon Goldberg | ### Prerequisites |
8 | * You have sudo installed and you have sudo permissions. |
||
9 | * You have a GPG key pair and SSH key pair on this computer. |
||
10 | * Your SSH public key for this computer must be added to your Gitea account. Ideally it's also on other servers. |
||
11 | * Your GPG public key must be added to the pass database, and it must be signed by Jon. |
||
12 | 14 | Jon Goldberg | * Nextcloud should be installed. |
13 | 13 | Jon Goldberg | NOTE: You can bootstrap without adding your server to crm.megaphonetech.com, but after bootstrap your server must be in the inventory. |
14 | 1 | Jon Goldberg | |
15 | 13 | Jon Goldberg | ### Bootstrap script |
16 | Run these commands: |
||
17 | 11 | Jon Goldberg | |
18 | 13 | Jon Goldberg | ```shell |
19 | 19 | Jon Goldberg | useradd -m ansible #untested, pretty sure this is correct. Need ansible user before we can run localhost-bootstrap. |
20 | 13 | Jon Goldberg | sudo apt install ansible git |
21 | git clone https://github.com/MegaphoneJon/ansible-main.git ansible |
||
22 | cd ansible |
||
23 | git submodule init |
||
24 | git submodule sync |
||
25 | git submodule update |
||
26 | # If this server has no desktop environment, you'll probably need to start ssh-agent manually. Otherwise skip the next 2 commands. |
||
27 | eval "$(ssh-agent)" |
||
28 | # This command will prompt you for your SSH passphrase. |
||
29 | ssh-add |
||
30 | # run the bootstrap. You'll be prompted for your 'BECOME password'; it's your user pw (for sudo). |
||
31 | 21 | Jon Goldberg | ansible-playbook localhost-bootstrap.yml --ask-become-pass --extra-vars "ansible_user=ansible" |
32 | 14 | Jon Goldberg | # Your computer must be in the "Server List" on crm.megaphonetech.com to do the next step. |
33 | 21 | Jon Goldberg | ansible-playbook provision.yml --tags bootstrap |
34 | 13 | Jon Goldberg | ``` |