Browse Source

Remove playbooks.

master
Chris Smith 9 years ago
parent
commit
f8730a2d36

+ 0
- 15
playbooks/ansible-staging.yml View File

@@ -1,15 +0,0 @@
1
----
2
-# Sets up servers to be used to push ansible configs out
3
-
4
-- hosts: ansible-staging
5
-  user: root
6
-  tasks:
7
-
8
-    - include: includes/install-from-ppa
9
-      vars:
10
-        package: ansible
11
-        ppa: ppa:rquillo/ansible
12
-        ppa_mint: deb http://ppa.launchpad.net/rquillo/ansible/ubuntu raring main
13
-
14
-    - name: install git
15
-      apt: pkg=git

+ 0
- 11
playbooks/bower.yml View File

@@ -1,11 +0,0 @@
1
----
2
-# Installs bower (http://bower.io/)
3
-
4
-- hosts: all
5
-  user: root
6
-  tasks:
7
-
8
-    - include: includes/install-nodejs
9
-
10
-    - name: install bower
11
-      npm: global=yes name=bower

+ 0
- 8
playbooks/chris-root.yml View File

@@ -1,8 +0,0 @@
1
----
2
-# Adds SSH keys for root access
3
-
4
-- hosts: chris-root
5
-  user: root
6
-  tasks:
7
-
8
-  - include: includes/ssh-keys user=root type=root key_dir=chris

+ 0
- 21
playbooks/chris-user.yml View File

@@ -1,21 +0,0 @@
1
----
2
-# Ensures that an appropriate 'Chris' user is created
3
-
4
-- hosts: chris-access
5
-  user: root
6
-  tasks:
7
-
8
-  - name: create chris user
9
-    user: name=chris
10
-
11
-  - include: includes/ssh-keys user=chris key_dir=chris
12
-
13
-  - name: deploy vimrc
14
-    remote_user: chris
15
-    copy: dest=~/.vimrc
16
-          src=/etc/ansible/data/config/chris-vimrc
17
-
18
-  - include: includes/install-fish
19
-
20
-  - name: set default shell to fish
21
-    user: name=chris shell=/usr/bin/fish

+ 0
- 88
playbooks/dmdirc-buildagent.yml View File

@@ -1,88 +0,0 @@
1
----
2
-# Sets up accounts for DMDirc build agents
3
-
4
-- hosts: dmdirc-buildagents
5
-  sudo: yes
6
-  user: root
7
-
8
-  vars:
9
-    home_dir: /home/{{ teamcity_user }}/
10
-    agent_sh: "{{ home_dir }}/bin/agent.sh"
11
-    conf: "{{ home_dir }}/conf/buildAgent.properties"
12
-    pid: "{{ home_dir }}/logs/buildAgent.pid"
13
-    temp_key: /etc/ansible/data/auto/keys/teamcity-{{ ansible_hostname }}
14
-    htaccess: /home/dmdirc/www/private/.htaccess
15
-    header: "# {{ inventory_hostname }}"
16
-
17
-  tasks:
18
-
19
-  - name: create teamcity user
20
-    user: name={{ teamcity_user }} generate_ssh_key=yes
21
-
22
-  - name: install pre-requisites
23
-    apt: pkg={{ item }}
24
-    with_items:
25
-      - ant
26
-      - git
27
-      - unzip
28
-      - nsis
29
-      - dpkg-dev
30
-      - cdbs
31
-      - debhelper
32
-      - javahelper
33
-      - mkisofs
34
-      - alien
35
-      - fakeroot
36
-
37
-  - include: includes/install-java8
38
-
39
-  - name: fetch agent zip
40
-    sudo_user: "{{ teamcity_user }}"
41
-    get_url: url=http://teamcity.dmdirc.com/update/buildAgent.zip dest={{ home_dir }}
42
-
43
-  - name: unpack agent zip
44
-    sudo_user: "{{ teamcity_user }}"
45
-    command: creates={{ agent_sh }} chdir={{ home_dir }} unzip -o buildAgent.zip
46
-
47
-  - name: make agent.sh executable
48
-    sudo_user: "{{ teamcity_user }}"
49
-    file: path={{ agent_sh }} mode=0755
50
-
51
-  - name: copy default configuration
52
-    sudo_user: "{{ teamcity_user }}"
53
-    command: creates={{ conf }} chdir={{ home_dir }}/conf cp buildAgent.dist.properties buildAgent.properties
54
-
55
-  - name: set teamcity server URL
56
-    sudo_user: "{{ teamcity_user }}"
57
-    lineinfile: dest={{ conf }} regexp=^serverUrl= line=serverUrl=http://teamcity.dmdirc.com/
58
-
59
-  - name: set build agent name
60
-    sudo_user: "{{ teamcity_user }}"
61
-    lineinfile: dest={{ conf }} regexp=^name= line=name={{ inventory_hostname }}
62
-
63
-  - name: add dmdirc.com to known hosts
64
-    sudo_user: "{{ teamcity_user }}"
65
-    lineinfile: dest={{ home_dir }}/.ssh/known_hosts regexp=^dmdirc.com
66
-                  line="dmdirc.com,85.234.138.10 {{ hostvars['renji.org.uk']['ssh_public_key'] }}"
67
-
68
-  - name: retrieve public key
69
-    sudo_user: "{{ teamcity_user }}"
70
-    fetch: src={{ home_dir }}/.ssh/id_rsa.pub dest={{ temp_key }} flat=yes
71
-
72
-  - name: add SSH key to dmdirc-artifacts
73
-    delegate_to: renji.org.uk
74
-    authorized_key: key="{{ lookup('file', temp_key) }}" user=dmdirc-artifacts
75
-
76
-  - name: add header to private .htaccess file
77
-    delegate_to: renji.org.uk
78
-    sudo_user: dmdirc
79
-    lineinfile: dest={{ htaccess }} line="{{ header }}" insertafter="^# Build agents:"
80
-
81
-  - name: add all IP addresses to .htaccess file
82
-    delegate_to: renji.org.uk
83
-    sudo_user: dmdirc
84
-    lineinfile: dest={{ htaccess }} line="Allow from {{ item }}" insertafter="{{ header }}"
85
-    with_items: ansible_all_ipv4_addresses
86
-
87
-  - include: includes/launch-app pid_file="{{ pid }}" start_command="{{ agent_sh }} start"
88
-    sudo_user: "{{ teamcity_user }}"

+ 0
- 10
playbooks/dmdirc-root.yml View File

@@ -1,10 +0,0 @@
1
----
2
-# Adds SSH keys for root access
3
-
4
-- hosts: dmdirc
5
-  user: root
6
-  tasks:
7
-
8
-  - include: includes/ssh-keys user=root type=root key_dir=chris
9
-  - include: includes/ssh-keys user=root type=root key_dir=greg
10
-  - include: includes/ssh-keys user=root type=root key_dir=shane

+ 0
- 7
playbooks/do1.yml View File

@@ -1,7 +0,0 @@
1
----
2
-- hosts: do1.chameth.com
3
-  user: root
4
-  roles:
5
-   - { role: sshd, ssh_root_key_glob: '/etc/ansible/data/keys/chris/root/*', ssh_revoked_root_key_glob: '/etc/ansible/data/keys/chris/revoked/*' }
6
-   - common
7
-   - java8

+ 0
- 16
playbooks/do2.yml View File

@@ -1,16 +0,0 @@
1
----
2
-- hosts: do2.chameth.com
3
-  user: root
4
-  vars:
5
-   - teamcity_server_url: 'http://teamcity.dmdirc.com/'
6
-  roles:
7
-   - { role: sshd, ssh_root_key_glob: '/etc/ansible/data/keys/chris/root/*', ssh_revoked_root_key_glob: '/etc/ansible/data/keys/chris/revoked/*' }
8
-   - common
9
-   - nginx
10
-   - java8
11
-   - tapchat
12
-   - teamcity-agent
13
-   - dfbnc
14
-   - mysql
15
-   - python-dev
16
-   - uwsgi

+ 0
- 8
playbooks/includes/install-fish View File

@@ -1,8 +0,0 @@
1
----
2
-# Adds the fish-shell release PPA and installs fish.
3
-
4
-- include: install-from-ppa
5
-  vars:
6
-    ppa: 'ppa:fish-shell/release-2'
7
-    ppa_mint: 'deb http://ppa.launchpad.net/fish-shell/release-2/ubuntu raring main'
8
-    package: 'fish'

+ 0
- 16
playbooks/includes/install-from-ppa View File

@@ -1,16 +0,0 @@
1
----
2
-# Adds a PPA and installs a package
3
-
4
-- name: install python-pycurl (needed to add {{ package }} PPA)
5
-  apt: pkg=python-pycurl
6
-
7
-- name: add PPA for {{ package }} (Debian)
8
-  apt_repository: repo="{{ ppa }}" update_cache=yes
9
-  when: ansible_os_family == 'Debian'
10
-
11
-- name: add PPA for {{ package }} (Mint)
12
-  apt_repository: repo="{{ ppa_mint }}" update_cache=yes
13
-  when: ansible_os_family == 'Linuxmint'
14
-
15
-- name: install {{ package }}
16
-  apt: pkg={{ package }} force=yes

+ 0
- 27
playbooks/includes/install-java8 View File

@@ -1,27 +0,0 @@
1
----
2
-# Adds the WebUpd8 PPA and installs Java8.
3
-
4
-- name: 'Install debconf-utils'
5
-  apt: pkg=debconf-utils
6
-
7
-- name: 'Check for oracle license agreement'
8
-  shell: '/usr/bin/debconf-get-selections | grep oracle-java8-installer'
9
-  register: selections
10
-  ignore_errors: yes
11
-  changed_when: False
12
-
13
-- name: 'Accept oracle license agreeement'
14
-  shell: 'echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections'
15
-  when: selections|failed
16
-
17
-- include: install-from-ppa
18
-  vars:
19
-    ppa: 'ppa:webupd8team/java'
20
-    ppa_mint: 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu saucy main'
21
-    package: 'oracle-java8-installer'
22
-
23
-- include: install-from-ppa
24
-  vars:
25
-    ppa: 'ppa:webupd8team/java'
26
-    ppa_mint: 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu saucy main'
27
-    package: 'oracle-java8-set-default'

+ 0
- 11
playbooks/includes/install-nodejs View File

@@ -1,11 +0,0 @@
1
----
2
-# Adds a node JS release PPA and installs node.
3
-
4
-- include: install-from-ppa
5
-  vars:
6
-    ppa: 'ppa:chris-lea/node.js'
7
-    ppa_mint: 'deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu raring main'
8
-    package: 'nodejs'
9
-
10
-- name: install npm
11
-  apt: pkg=npm force=yes

+ 0
- 13
playbooks/includes/launch-app View File

@@ -1,13 +0,0 @@
1
----
2
-# Launches an app if its PID file doesn't exist or is stale
3
-
4
-- name: check if process is running
5
-  shell: ps p `cat {{ pid_file }}` executable=/bin/bash
6
-  ignore_errors: true
7
-  failed_when: false
8
-  changed_when: false
9
-  register: pid_result
10
-
11
-- name: start process
12
-  command: "{{ start_command }}"
13
-  when: pid_result|failed

+ 0
- 15
playbooks/includes/ssh-keys View File

@@ -1,15 +0,0 @@
1
----
2
-# Maintains a set of SSH keys
3
-
4
-- name: add {{ key_dir }}'s authorized keys for {{ user }}
5
-  authorized_key: user={{ user }}
6
-                  key="{{ lookup('file', item) }}"
7
-  with_fileglob:
8
-    - /etc/ansible/data/keys/{{ key_dir }}/{{ type | default('active') }}/*
9
-
10
-- name: revoke {{ key_dir }}'s old authorized keys for {{ user }}
11
-  authorized_key: user={{ user }}
12
-                  key="{{ lookup('file', item) }}"
13
-                  state=absent
14
-  with_fileglob:
15
-    - /etc/ansible/data/keys/{{ key_dir }}/revoked/*

+ 0
- 11
playbooks/shane-user.yml View File

@@ -1,11 +0,0 @@
1
----
2
-# Ensures that an appropriate 'Shane' user is created
3
-
4
-- hosts: dmdirc
5
-  user: root
6
-  tasks:
7
-
8
-  - name: create shane user
9
-    user: name=shane
10
-
11
-  - include: includes/ssh-keys user=shane key_dir=shane

Loading…
Cancel
Save