aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 8e987fd126e0ba2c509cbcaebfa03fe8feae7f85 (plain)
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

This repo contains helpful Ansible scripts for maintaining the bnewbold's
servers and infrastructure.

Be sure to keep things compatible with ansible 1.7.2 (the version in Debian
jessie).

Check out `NOW_WHAT.md` for next steps after creating a server with these
scripts.

Vault:
    export ANSIBLE_VAULT_PASSWORD_FILE=vault_pass.txt
    http://docs.ansible.com/ansible/playbooks_vault.html

Example playbook call:
    ansible-playbook -i hosts playbooks/init_adze.yml --vault-password-file=vault_pass.txt

Run a single role (helpful for dev):
    ansible-playbook -i hosts playbooks/init_adze.yml --vault-password-file=vault_pass.txt -t nginx

===== IRC Setup

How to set up the IRC password hash…

    # znc --makepass
    [ ** ] Type your new password.
    [ ?? ] Enter Password: foo
    [ ?? ] Confirm Password: foo
    [ ** ] Kill ZNC process, if it's running.
    [ ** ] Then replace password in the <User> section of your config with this:
    <Pass password>
            Method = sha256
            Hash = 310c5f99825e80d5b1d663a0a993b8701255f16b2f6056f335ba6e3e720e57ed
            Salt = YdlPM5yjBmc/;JO6cfL5
    </Pass>
    [ ** ] After that start ZNC again, and you should be able to login with the new password.

Take the strings after `Hash =` and `Salt =` and insert them as the value for `irc_password_hash` and `irc_password_salt` respectively.

Alternatively, if you don’t already have `znc` installed, Python 3.3 or higher on Linux will generate the appropriate string for you (assuming your password is `password`):

    python3 -c 'import crypt; print("irc_password_salt: {}\nirc_password_hash: {}".format(*crypt.crypt("password", salt=crypt.METHOD_SHA256).split("$")[2:]))'

On OS X and other platforms the passlib:https://pythonhosted.org/passlib/ package may be used to generate the required string:

    python -c 'import passlib.hash; print("irc_password_salt: {}\nirc_password_hash: {}".format(*passlib.hash.sha256_crypt.encrypt("password", rounds=5000).split("$")[2:]))'