source: darkpeak-services/README.md @ 0c882bec

ansiblekeycloakmatrixpleroma
Last change on this file since 0c882bec was 0c882bec, checked in by Caolan McMahon <caolan.mcmahon@…>, 19 months ago

Switch sabredav to mysql so we can copy over existing data

  • Property mode set to 100644
File size: 3.0 KB
Line 
1# Dark Peak Services Repo
2
3Before proceeding, make sure you've cloned this repo and initialised its submodules:
4
5    git clone caolan@git.darkpeak.org:darkpeak-services.git
6    cd darkpeak-services
7    git checkout ansible # Work done on a separate branch until we are ready to switch over from docker
8    git submodule init
9    git submodule update
10   
11## Install Ansible 2.4+
12
13The geerlingguy playbooks for postgresql and mysql (in `roles/community`) use features like `include_tasks` which were introduced in Ansible 2.4. You should make sure your ansible version is >= 2.4.
14
15### Installing a newer ansible on Debian Stretch
16
17Add the following to `sources.list` (or add a new file with the
18`.list` extension to `/etc/apt/sources.list.d/`):
19
20    deb http://ftp.uk.debian.org/debian stretch-backports main
21
22Then run:
23
24    sudo apt-get update
25    sudo apt-get install -t stretch-backports ansible
26
27## Create Your Development Playbook
28
29Make a copy of the production playbook and edit it to include only those services on which you want to work:
30
31    cp prod-playbook.yml dev-playbook.yml
32    sed -i '/mastodon/d' dev-playbook.yml # You're a damn time sink, mastodon
33
34Then set the "development_mode" variable to "true" and the "domain_name" variable to something appropriate, like "darkpeak.dev" and you are ready to go.
35
36## Developing With Vagrant
37
38Run the playbook:
39
40    vagrant up
41
42If using the libvirt provider, you can avoid being prompted for your password everytime by adding yourself to the appropriate group:
43
44    sudo usermod -aG libvirt $USER
45
46## Developing Without Vagrant
47
48For those that are unable to use Virtual Box due to it requiring you to disable Secure Boot, and if you cannot use libvirt as a Vagrant back-end, you can run the playbook directly at a pre-existing VM, but it needs some preparation first.
49
50Create and install a Debian VM using libvirt (at least 1Gb memory is needed):
51
52    virt-install --connect=qemu:///system --name darkpeak --arch x86_64 --vcpus 2 --memory 4096 --disk size=20 \
53      --location http://ftp.us.debian.org/debian/dists/stretch/main/installer-amd64/
54
55Copy your SSH public key into the machine:
56
57    ssh darkpeak.vm mkdir .ssh
58    scp ~/.ssh/id_vms.pub darkpeak.vm:~/.ssh/authorized_keys
59    ssh darkpeak.vm chmod 600 .ssh/authorized_keys
60
61On the VM, install sudo:
62
63    apt install sudo
64
65On the VM, add your user to the sudo group:
66
67    usermod -aG sudo $USER
68
69On the VM, grant sudoers permission to run commands unprompted by a password by adding the following line to the sudoers file:
70
71    %sudo   ALL=(ALL:ALL) NOPASSWD: ALL
72
73Run the playbook:
74
75    ansible-playbook -i darkpeak.vm, dev-playbook.yml
76
77## Testing
78
79In order to test, you will need to add hostnames to your hosts file. The TLD has to match that which you used earlier when you edited your development playbook. If you set the domain name variable to "darkpeak.dev" and you are working on the wiki and irc bouncer, for example, then add the following to your /etc/hosts file substituting your VM's IP:
80
81    192.168.33.10 wiki.darkpeak.dev irc.darkpeak.dev
Note: See TracBrowser for help on using the repository browser.