taperole 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/CONTRIBUTING.md +8 -0
  4. data/README.md +33 -4
  5. data/Rakefile +6 -0
  6. data/Vagrantfile +6 -7
  7. data/bin/tape +2 -89
  8. data/lib/taperole/commands/ansible.rb +56 -0
  9. data/lib/taperole/commands/installer.rb +19 -0
  10. data/lib/taperole/commands/tape.rb +32 -0
  11. data/lib/taperole/core/ansible_runner.rb +86 -0
  12. data/lib/taperole/core/installer.rb +87 -0
  13. data/lib/taperole/core/notifier.rb +47 -0
  14. data/lib/taperole/helpers/files.rb +76 -0
  15. data/lib/taperole/helpers/logging.rb +37 -0
  16. data/lib/taperole/notifiers/slack.rb +83 -0
  17. data/lib/taperole/version.rb +3 -0
  18. data/lib/taperole.rb +24 -0
  19. data/requirements.yml +1 -1
  20. data/roles/backend_checkout/tasks/main.yml +1 -0
  21. data/roles/delayed_job/tasks/main.yml +0 -15
  22. data/roles/deployer_user/tasks/keys.yml +6 -6
  23. data/roles/deployer_user/tasks/main.yml +0 -3
  24. data/roles/monit_install/tasks/main.yml +6 -0
  25. data/roles/monit_install/templates/monitrc.j2 +290 -0
  26. data/roles/nginx/tasks/main.yml +3 -4
  27. data/roles/nginx/templates/nginx_unicorn.j2 +1 -0
  28. data/roles/node/tasks/main.yml +2 -1
  29. data/roles/ruby/tasks/main.yml +3 -11
  30. data/roles/unicorn_install/tasks/main.yml +0 -3
  31. data/roles/unicorn_install/templates/unicorn.rb.j2 +1 -1
  32. data/roles/unicorn_install/templates/unicorn_init.j2 +1 -1
  33. data/roles/unicorn_install/templates/unicorn_monit.j2 +1 -1
  34. data/spec/commands/installer_spec.rb +117 -0
  35. data/spec/spec_helper.rb +24 -0
  36. data/taperole.gemspec +8 -1
  37. data/templates/base/deploy.example.yml +1 -0
  38. data/templates/base/hosts.example +1 -1
  39. data/templates/base/omnibox.example.yml +15 -0
  40. data/templates/base/rake.example.yml +18 -0
  41. data/templates/base/tape_vars.example.yml +9 -8
  42. data/templates/static_html/omnibox.example.yml +13 -0
  43. data/test/base_docker_box/Dockerfile +1 -1
  44. data/test/rails/Dockerfile +3 -3
  45. data/test/rails/start_rails.sh +1 -0
  46. data/test/rails/tape_vars.yml +2 -2
  47. data/vendor/ANXS.postgresql/.travis.yml +27 -12
  48. data/vendor/ANXS.postgresql/README.md +1 -1
  49. data/vendor/ANXS.postgresql/Vagrantfile +7 -2
  50. data/vendor/ANXS.postgresql/meta/.galaxy_install_info +1 -1
  51. data/vendor/ANXS.postgresql/meta/main.yml +1 -1
  52. data/vendor/ANXS.postgresql/tasks/configure.yml +10 -10
  53. data/vendor/ANXS.postgresql/tasks/databases.yml +27 -27
  54. data/vendor/ANXS.postgresql/tasks/install_yum.yml +2 -2
  55. data/vendor/ANXS.postgresql/tasks/users.yml +4 -4
  56. data/vendor/ANXS.postgresql/tasks/users_privileges.yml +3 -3
  57. data/vendor/ANXS.postgresql/tests/Dockerfile-centos6 +20 -0
  58. data/vendor/ANXS.postgresql/tests/Dockerfile-ubuntu14.04 +17 -0
  59. data/vendor/ANXS.postgresql/tests/playbook.yml +1 -1
  60. data/vendor/ANXS.postgresql/tests/vars.yml +2 -0
  61. data/vendor/Stouts.backup/.bumpversion.cfg +1 -1
  62. data/vendor/Stouts.backup/.travis.yml +0 -1
  63. data/vendor/Stouts.backup/CONTRIBUTORS +2 -0
  64. data/vendor/Stouts.backup/README.md +1 -0
  65. data/vendor/Stouts.backup/defaults/main.yml +3 -3
  66. data/vendor/Stouts.backup/meta/.galaxy_install_info +1 -1
  67. data/vendor/Stouts.backup/runtests.sh +65 -0
  68. data/vendor/Stouts.backup/tasks/backup.yml +3 -0
  69. data/vendor/Stouts.backup/tasks/configure.yml +13 -12
  70. data/vendor/Stouts.backup/tasks/install.deb.yml +6 -8
  71. data/vendor/Stouts.backup/tasks/install.red.yml +28 -0
  72. data/vendor/Stouts.backup/tasks/remove.yml +3 -3
  73. data/vendor/Stouts.backup/templates/cron.j2 +1 -1
  74. data/vendor/Stouts.backup/templates/duply.sh.j2 +219 -218
  75. data/vendor/Stouts.backup/templates/pre.j2 +6 -0
  76. data/vendor/Stouts.backup/templates/restore.j2 +6 -0
  77. data/vendor/Stouts.backup/vars/Debian.yml +3 -0
  78. data/vendor/Stouts.backup/vars/Ubuntu.yml +1 -0
  79. metadata +67 -10
  80. data/lib/tape/ansible_runner.rb +0 -130
  81. data/lib/tape/info.rb +0 -9
  82. data/lib/tape/installer.rb +0 -160
  83. data/lib/tape/notifiers/slack.rb +0 -79
  84. data/lib/tape/overwriter.rb +0 -14
  85. data/lib/tape/qemu_provisioner.rb +0 -167
  86. data/lib/tape.rb +0 -127
@@ -2,7 +2,7 @@
2
2
 
3
3
  - hosts: all
4
4
  remote_user: root
5
- sudo: yes
5
+ become: yes
6
6
  vars_files:
7
7
  - ./vars.yml
8
8
  roles:
@@ -14,6 +14,8 @@ postgresql_users:
14
14
  pass: md51a1dc91c907325c69271ddf0c944bc72
15
15
  encrypted: yes
16
16
 
17
+ - name: zabaz
18
+
17
19
  postgresql_user_privileges:
18
20
  - name: baz
19
21
  db: foobar
@@ -1,6 +1,6 @@
1
1
  [bumpversion]
2
2
  commit = True
3
- current_version = 3.3.0
3
+ current_version = 3.4.5
4
4
  tag = True
5
5
  tag_name = {new_version}
6
6
 
@@ -27,7 +27,6 @@ script:
27
27
  - test -d /home/travis/test || exit 1
28
28
 
29
29
  backup_home: /home/travis/backup
30
- backup_duplicity_version: 0.6.18-0ubuntu3.5
31
30
  backup_profiles:
32
31
  - name: test
33
32
  source: /home/travis/build
@@ -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 # Backup configuration directory
10
- backup_work: /var/duply # Working directory
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: 'Mon May 16 16:58:23 2016', version: 3.3.0}
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
@@ -3,6 +3,9 @@
3
3
  - include: install.deb.yml
4
4
  when: ansible_os_family == "Debian" and not backup_remove
5
5
 
6
+ - include: install.red.yml
7
+ when: ansible_os_family == "RedHat" and not backup_remove
8
+
6
9
  - include: configure.yml
7
10
  when: not backup_remove
8
11
 
@@ -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
- - "{{backup_home}}"
10
- - "{{backup_work}}"
11
- - "{{backup_logdir}}"
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/local/bin/duply owner={{backup_user}} group={{backup_group}} mode=0755
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
- - name: Add duplicity ppa
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: pkg={{item}}
6
+ apt: name={{item}}
9
7
  with_items:
10
- - cron
11
- - gzip
12
- - python-boto
13
- - s3cmd
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}}
@@ -7,6 +7,6 @@
7
7
  - name: Uninstall the role - pt. 2
8
8
  file: state=absent path={{item}}
9
9
  with_items:
10
- - "{{backup_home}}"
11
- - "{{backup_work}}"
12
- - "{{backup_logdir}}"
10
+ - "{{backup_home}}"
11
+ - "{{backup_work}}"
12
+ - "{{backup_logdir}}"
@@ -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/local/bin/duply {{backup_home}}/{{profile.name}} {{profile.action|default('backup')}} >> {{backup_logdir}}/{{profile.name}}.log 2>&1
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