taperole 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CONTRIBUTING.md +8 -0
- data/README.md +33 -4
- data/Rakefile +6 -0
- data/Vagrantfile +6 -7
- data/bin/tape +2 -89
- data/lib/taperole/commands/ansible.rb +56 -0
- data/lib/taperole/commands/installer.rb +19 -0
- data/lib/taperole/commands/tape.rb +32 -0
- data/lib/taperole/core/ansible_runner.rb +86 -0
- data/lib/taperole/core/installer.rb +87 -0
- data/lib/taperole/core/notifier.rb +47 -0
- data/lib/taperole/helpers/files.rb +76 -0
- data/lib/taperole/helpers/logging.rb +37 -0
- data/lib/taperole/notifiers/slack.rb +83 -0
- data/lib/taperole/version.rb +3 -0
- data/lib/taperole.rb +24 -0
- data/requirements.yml +1 -1
- data/roles/backend_checkout/tasks/main.yml +1 -0
- data/roles/delayed_job/tasks/main.yml +0 -15
- data/roles/deployer_user/tasks/keys.yml +6 -6
- data/roles/deployer_user/tasks/main.yml +0 -3
- data/roles/monit_install/tasks/main.yml +6 -0
- data/roles/monit_install/templates/monitrc.j2 +290 -0
- data/roles/nginx/tasks/main.yml +3 -4
- data/roles/nginx/templates/nginx_unicorn.j2 +1 -0
- data/roles/node/tasks/main.yml +2 -1
- data/roles/ruby/tasks/main.yml +3 -11
- data/roles/unicorn_install/tasks/main.yml +0 -3
- data/roles/unicorn_install/templates/unicorn.rb.j2 +1 -1
- data/roles/unicorn_install/templates/unicorn_init.j2 +1 -1
- data/roles/unicorn_install/templates/unicorn_monit.j2 +1 -1
- data/spec/commands/installer_spec.rb +117 -0
- data/spec/spec_helper.rb +24 -0
- data/taperole.gemspec +8 -1
- data/templates/base/deploy.example.yml +1 -0
- data/templates/base/hosts.example +1 -1
- data/templates/base/omnibox.example.yml +15 -0
- data/templates/base/rake.example.yml +18 -0
- data/templates/base/tape_vars.example.yml +9 -8
- data/templates/static_html/omnibox.example.yml +13 -0
- data/test/base_docker_box/Dockerfile +1 -1
- data/test/rails/Dockerfile +3 -3
- data/test/rails/start_rails.sh +1 -0
- data/test/rails/tape_vars.yml +2 -2
- data/vendor/ANXS.postgresql/.travis.yml +27 -12
- data/vendor/ANXS.postgresql/README.md +1 -1
- data/vendor/ANXS.postgresql/Vagrantfile +7 -2
- data/vendor/ANXS.postgresql/meta/.galaxy_install_info +1 -1
- data/vendor/ANXS.postgresql/meta/main.yml +1 -1
- data/vendor/ANXS.postgresql/tasks/configure.yml +10 -10
- data/vendor/ANXS.postgresql/tasks/databases.yml +27 -27
- data/vendor/ANXS.postgresql/tasks/install_yum.yml +2 -2
- data/vendor/ANXS.postgresql/tasks/users.yml +4 -4
- data/vendor/ANXS.postgresql/tasks/users_privileges.yml +3 -3
- data/vendor/ANXS.postgresql/tests/Dockerfile-centos6 +20 -0
- data/vendor/ANXS.postgresql/tests/Dockerfile-ubuntu14.04 +17 -0
- data/vendor/ANXS.postgresql/tests/playbook.yml +1 -1
- data/vendor/ANXS.postgresql/tests/vars.yml +2 -0
- data/vendor/Stouts.backup/.bumpversion.cfg +1 -1
- data/vendor/Stouts.backup/.travis.yml +0 -1
- data/vendor/Stouts.backup/CONTRIBUTORS +2 -0
- data/vendor/Stouts.backup/README.md +1 -0
- data/vendor/Stouts.backup/defaults/main.yml +3 -3
- data/vendor/Stouts.backup/meta/.galaxy_install_info +1 -1
- data/vendor/Stouts.backup/runtests.sh +65 -0
- data/vendor/Stouts.backup/tasks/backup.yml +3 -0
- data/vendor/Stouts.backup/tasks/configure.yml +13 -12
- data/vendor/Stouts.backup/tasks/install.deb.yml +6 -8
- data/vendor/Stouts.backup/tasks/install.red.yml +28 -0
- data/vendor/Stouts.backup/tasks/remove.yml +3 -3
- data/vendor/Stouts.backup/templates/cron.j2 +1 -1
- data/vendor/Stouts.backup/templates/duply.sh.j2 +219 -218
- data/vendor/Stouts.backup/templates/pre.j2 +6 -0
- data/vendor/Stouts.backup/templates/restore.j2 +6 -0
- data/vendor/Stouts.backup/vars/Debian.yml +3 -0
- data/vendor/Stouts.backup/vars/Ubuntu.yml +1 -0
- metadata +67 -10
- data/lib/tape/ansible_runner.rb +0 -130
- data/lib/tape/info.rb +0 -9
- data/lib/tape/installer.rb +0 -160
- data/lib/tape/notifiers/slack.rb +0 -79
- data/lib/tape/overwriter.rb +0 -14
- data/lib/tape/qemu_provisioner.rb +0 -167
- data/lib/tape.rb +0 -127
@@ -2,6 +2,8 @@ Contributors:
|
|
2
2
|
|
3
3
|
* Alexander Merkulov (https://github.com/merqlove)
|
4
4
|
* Clemens Stolle (https://github.com/klaemo)
|
5
|
+
* Gaetan Zoritchak (https://github.com/gzoritchak)
|
5
6
|
* George Yanev (https://github.com/geyanev)
|
6
7
|
* Kirill Klenov (http://klen.github.io/)
|
8
|
+
* Paul Maunders (https://github.com/paulmaunders)
|
7
9
|
* Viator (https://github.com/viatoriche)
|
@@ -14,6 +14,7 @@ The role variables and default values.
|
|
14
14
|
```yaml
|
15
15
|
backup_enabled: yes # Enable the role
|
16
16
|
backup_remove: no # Set yes for uninstall the role from target system
|
17
|
+
backup_cron: yes # Setup cron tasks for backup
|
17
18
|
|
18
19
|
backup_user: root # Run backups as user
|
19
20
|
backup_group: "{{backup_user}}"
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
backup_enabled: yes # Enable the role
|
4
4
|
backup_remove: no # Set yes for uninstall the role from target system
|
5
|
+
backup_cron: yes # Setup cron tasks for backup
|
5
6
|
|
6
7
|
backup_user: root # Run backups as user
|
7
8
|
backup_group: "{{backup_user}}"
|
8
9
|
|
9
|
-
backup_home: /etc/duply
|
10
|
-
backup_work: /var/duply
|
10
|
+
backup_home: /etc/duply # Backup configuration directory
|
11
|
+
backup_work: /var/duply # Working directory
|
11
12
|
|
12
|
-
backup_duplicity_ppa: ppa:duplicity-team/ppa # Set empty for skipping PPA addition
|
13
13
|
backup_duplicity_pkg: duplicity
|
14
14
|
backup_duplicity_version: # Set duplicity version
|
15
15
|
|
@@ -1 +1 @@
|
|
1
|
-
{install_date: '
|
1
|
+
{install_date: 'Wed Sep 28 17:36:01 2016', version: 3.4.5}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
IMAGES=(
|
4
|
+
"horneds/stouts-centos7"
|
5
|
+
"horneds/stouts-ubuntu14.04"
|
6
|
+
"horneds/stouts-debian8"
|
7
|
+
)
|
8
|
+
|
9
|
+
TESTS=(
|
10
|
+
"ansible-playbook -c local --syntax-check test.yml"
|
11
|
+
"ansible-playbook -c local test.yml"
|
12
|
+
"test -x /usr/bin/duply"
|
13
|
+
)
|
14
|
+
|
15
|
+
APPDIR=/var/tests
|
16
|
+
CURDIR=`pwd`
|
17
|
+
ARGS=("$@")
|
18
|
+
|
19
|
+
docker info || exit 1
|
20
|
+
|
21
|
+
assert () {
|
22
|
+
echo "ASSERT: $1"
|
23
|
+
execute "$@" || ( echo ${2-'Test is failed'} && exit 1 )
|
24
|
+
echo "SUCCESS"
|
25
|
+
}
|
26
|
+
|
27
|
+
execute () {
|
28
|
+
docker exec -it $RUNNER $1
|
29
|
+
return $?
|
30
|
+
}
|
31
|
+
|
32
|
+
suite () {
|
33
|
+
|
34
|
+
echo "================="
|
35
|
+
echo "RUN IMAGE: $1"
|
36
|
+
echo "================="
|
37
|
+
|
38
|
+
for TEST in "${TESTS[@]}"; do
|
39
|
+
assert "$TEST" || ( echo "FAILED" && exit 1 )
|
40
|
+
done
|
41
|
+
|
42
|
+
echo
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
for IMAGE in "${IMAGES[@]}"
|
48
|
+
do
|
49
|
+
|
50
|
+
RUNNER=`docker run -v $CURDIR:$APPDIR -w $APPDIR -dit $IMAGE bash`
|
51
|
+
|
52
|
+
suite $IMAGE || {
|
53
|
+
echo "Tests are failed $IMAGE"
|
54
|
+
docker stop $RUNNER
|
55
|
+
exit 1
|
56
|
+
}
|
57
|
+
|
58
|
+
if [[ "$1" = "shell" ]]; then
|
59
|
+
echo "Run shell"
|
60
|
+
execute /bin/bash
|
61
|
+
fi
|
62
|
+
|
63
|
+
docker stop $RUNNER
|
64
|
+
|
65
|
+
done
|
@@ -6,47 +6,48 @@
|
|
6
6
|
- name: backup-configure | Ensure for backup directories is exits
|
7
7
|
file: path={{item}} state=directory owner={{backup_user}} group={{backup_group}}
|
8
8
|
with_items:
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
- "{{backup_home}}"
|
10
|
+
- "{{backup_work}}"
|
11
|
+
- "{{backup_logdir}}"
|
12
12
|
|
13
13
|
- name: backup-configure | Install duply
|
14
|
-
template: src=duply.sh.j2 dest=/usr/
|
14
|
+
template: src=duply.sh.j2 dest=/usr/bin/duply owner={{backup_user}} group={{backup_group}} mode=0755
|
15
15
|
|
16
16
|
- name: backup-configure | Create profile directories
|
17
17
|
file: path={{backup_home}}/{{item.name}} state=directory mode=0700 owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
18
|
-
with_items: backup_profiles
|
18
|
+
with_items: "{{backup_profiles}}"
|
19
19
|
|
20
20
|
- name: backup-configure | Configure profiles
|
21
21
|
template: src=conf.j2 dest={{backup_home}}/{{item.name}}/conf owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
22
|
-
with_items: backup_profiles
|
22
|
+
with_items: "{{backup_profiles}}"
|
23
23
|
|
24
24
|
- name: backup-configure | Configure exclude lists
|
25
25
|
template: src=exclude.j2 dest={{backup_home}}/{{item.name}}/exclude owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
26
|
-
with_items: backup_profiles
|
26
|
+
with_items: "{{backup_profiles}}"
|
27
27
|
|
28
28
|
- name: backup-configure | Configure pre scripts
|
29
29
|
template: src=pre.j2 dest={{backup_home}}/{{item.name}}/pre owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
30
|
-
with_items: backup_profiles
|
30
|
+
with_items: "{{backup_profiles}}"
|
31
31
|
|
32
32
|
- name: backup-configure | Configure post scripts
|
33
33
|
template: src=post.j2 dest={{backup_home}}/{{item.name}}/post owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
34
|
-
with_items: backup_profiles
|
34
|
+
with_items: "{{backup_profiles}}"
|
35
35
|
|
36
36
|
- name: backup-configure | Configure restore scripts
|
37
37
|
template: src=restore.j2 dest={{backup_home}}/{{item.name}}/restore owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
38
|
-
with_items: backup_profiles
|
38
|
+
with_items: "{{backup_profiles}}"
|
39
39
|
|
40
40
|
- name: backup-configure | Create work directories
|
41
41
|
file: state=directory path={{backup_work}}/{{item.name}} owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
42
|
-
with_items: backup_profiles
|
42
|
+
with_items: "{{backup_profiles}}"
|
43
43
|
|
44
44
|
- name: backup-configure | Setup cron
|
45
45
|
template: src=cron.j2 dest=/etc/cron.d/backup owner=root group=root mode=0644
|
46
|
+
when: backup_cron
|
46
47
|
|
47
48
|
- name: backup-configure | Create log files
|
48
49
|
file: state=touch path={{backup_logdir}}/{{item.name}}.log owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}}
|
49
|
-
with_items: backup_profiles
|
50
|
+
with_items: "{{backup_profiles}}"
|
50
51
|
changed_when: False
|
51
52
|
|
52
53
|
- name: backup-configure | Configure logrotate
|
@@ -1,16 +1,14 @@
|
|
1
1
|
---
|
2
2
|
|
3
|
-
-
|
4
|
-
apt_repository: repo='{{ backup_duplicity_ppa }}' update_cache=yes
|
5
|
-
when: backup_duplicity_ppa
|
3
|
+
- include_vars: "{{ansible_distribution}}.yml"
|
6
4
|
|
7
5
|
- name: Install dependencies
|
8
|
-
apt:
|
6
|
+
apt: name={{item}}
|
9
7
|
with_items:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
- cron
|
9
|
+
- gzip
|
10
|
+
- python-boto
|
11
|
+
- s3cmd
|
14
12
|
|
15
13
|
- set_fact: backup_duplicity_pkg="{{backup_duplicity_pkg}}={{backup_duplicity_version}}"
|
16
14
|
when: backup_duplicity_version
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
- name: Ensure libselinux-python is installed
|
4
|
+
yum: name=libselinux-python
|
5
|
+
|
6
|
+
- name: Install EPEL repo
|
7
|
+
yum:
|
8
|
+
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
|
9
|
+
state: present
|
10
|
+
|
11
|
+
- name: Import EPEL GPG key
|
12
|
+
rpm_key:
|
13
|
+
key: "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
|
14
|
+
state: present
|
15
|
+
|
16
|
+
- name: Install dependencies
|
17
|
+
yum: name={{item}}
|
18
|
+
with_items:
|
19
|
+
- cronie
|
20
|
+
- gzip
|
21
|
+
- python-boto
|
22
|
+
- s3cmd
|
23
|
+
|
24
|
+
- set_fact: backup_duplicity_pkg="{{backup_duplicity_pkg}}-{{backup_duplicity_version}}"
|
25
|
+
when: backup_duplicity_version
|
26
|
+
|
27
|
+
- name: Install duplicity
|
28
|
+
yum: name={{backup_duplicity_pkg}}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Run backups
|
5
5
|
{% for profile in backup_profiles %}
|
6
6
|
{% if profile.schedule|default(None) %}
|
7
|
-
{{profile.schedule}} {{profile.user|default(backup_user)}} /usr/
|
7
|
+
{{profile.schedule}} {{profile.user|default(backup_user)}} /usr/bin/duply {{backup_home}}/{{profile.name}} {{profile.action|default('backup')}} >> {{backup_logdir}}/{{profile.name}}.log 2>&1
|
8
8
|
{% endif %}
|
9
9
|
{% endfor %}
|
10
10
|
|