Project

General

Profile

Ansible Setup » History » Version 15

Jon Goldberg, 10/19/2020 06:02 PM

1 1 Jon Goldberg
# Ansible Setup
2
3 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.
4 1 Jon Goldberg
5 13 Jon Goldberg
### Prerequisites
6
* You have sudo installed and you have sudo permissions.
7
* You have a GPG key pair and SSH key pair on this computer.
8
* Your SSH public key for this computer must be added to your Gitea account.  Ideally it's also on other servers.
9
* Your GPG public key must be added to the pass database, and it must be signed by Jon.
10 14 Jon Goldberg
* Nextcloud should be installed.
11 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.
12 1 Jon Goldberg
13 13 Jon Goldberg
### Bootstrap script
14
Run these commands:
15 11 Jon Goldberg
16 13 Jon Goldberg
```shell
17
sudo apt install ansible git
18
git clone https://github.com/MegaphoneJon/ansible-main.git ansible
19
cd ansible
20
git submodule init
21
git submodule sync
22
git submodule update
23 15 Jon Goldberg
# Install some extra Ansible plugins
24
ansible-galaxy collection install ansible.posix
25 13 Jon Goldberg
# If this server has no desktop environment, you'll probably need to start ssh-agent manually. Otherwise skip the next 2 commands.
26
eval "$(ssh-agent)"
27
# This command will prompt you for your SSH passphrase.
28
ssh-add
29
# run the bootstrap. You'll be prompted for your 'BECOME password'; it's your user pw (for sudo).
30 1 Jon Goldberg
ansible-playbook localhost-bootstrap.yml --ask-become-pass
31 14 Jon Goldberg
# Your computer must be in the "Server List" on crm.megaphonetech.com to do the next step.
32
run provision.yml --tags bootstrap
33 13 Jon Goldberg
```