taperole 1.3.6 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +11 -12
  4. data/lib/tape/ansible_runner.rb +1 -1
  5. data/lib/tape/installer.rb +0 -8
  6. data/lib/tape.rb +2 -2
  7. data/requirements.yml +5 -5
  8. data/roles/backend_install_essentials/meta/main.yml +2 -2
  9. data/roles/frontend_install_essentials/meta/main.yml +1 -1
  10. data/roles/frontend_install_essentials/tasks/main.yml +6 -2
  11. data/roles/node/tasks/main.yml +35 -0
  12. data/roles/node/templates/nvm.sh +5 -0
  13. data/taperole.gemspec +1 -1
  14. data/vars/defaults.yml +3 -2
  15. data/vendor/ANXS.postgresql/.travis.yml +25 -10
  16. data/vendor/ANXS.postgresql/README.md +29 -5
  17. data/vendor/ANXS.postgresql/Vagrantfile +14 -6
  18. data/vendor/ANXS.postgresql/ansible.cfg +2 -0
  19. data/vendor/ANXS.postgresql/defaults/main.yml +49 -25
  20. data/vendor/ANXS.postgresql/handlers/main.yml +1 -1
  21. data/vendor/ANXS.postgresql/meta/.galaxy_install_info +1 -1
  22. data/vendor/ANXS.postgresql/meta/main.yml +1 -1
  23. data/vendor/ANXS.postgresql/tasks/configure.yml +76 -10
  24. data/vendor/ANXS.postgresql/tasks/databases.yml +21 -11
  25. data/vendor/ANXS.postgresql/tasks/extensions/contrib.yml +9 -1
  26. data/vendor/ANXS.postgresql/tasks/install.yml +2 -2
  27. data/vendor/ANXS.postgresql/tasks/install_yum.yml +36 -0
  28. data/vendor/ANXS.postgresql/tasks/main.yml +11 -0
  29. data/vendor/ANXS.postgresql/tasks/users.yml +2 -1
  30. data/vendor/ANXS.postgresql/templates/HOWTO.postgresql.conf +21 -0
  31. data/vendor/ANXS.postgresql/templates/etc_systemd_system_postgresql.service.d_custom.conf.j2 +11 -0
  32. data/vendor/ANXS.postgresql/templates/pg_hba.conf.j2 +4 -0
  33. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.1.j2 +561 -0
  34. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.2.j2 +578 -0
  35. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.3.j2 +4 -0
  36. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.4.j2 +4 -0
  37. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.5.j2 +622 -0
  38. data/vendor/ANXS.postgresql/tests/idempotence_check.sh +28 -0
  39. data/vendor/ANXS.postgresql/tests/playbook.yml +9 -0
  40. data/vendor/ANXS.postgresql/{vars/test.yml → tests/vars.yml} +10 -1
  41. data/vendor/ANXS.postgresql/vagrant-inventory +1 -1
  42. data/vendor/ANXS.postgresql/vars/Debian.yml +4 -0
  43. data/vendor/ANXS.postgresql/vars/RedHat.yml +14 -0
  44. data/vendor/ANXS.postgresql/vars/empty.yml +2 -0
  45. data/vendor/geerlingguy.memcached/.gitignore +1 -0
  46. data/vendor/geerlingguy.memcached/.travis.yml +34 -0
  47. data/vendor/geerlingguy.memcached/README.md +53 -0
  48. data/vendor/geerlingguy.memcached/defaults/main.yml +9 -0
  49. data/vendor/geerlingguy.memcached/handlers/main.yml +3 -0
  50. data/vendor/geerlingguy.memcached/meta/.galaxy_install_info +1 -0
  51. data/vendor/geerlingguy.memcached/meta/main.yml +24 -0
  52. data/vendor/geerlingguy.memcached/tasks/main.yml +29 -0
  53. data/vendor/geerlingguy.memcached/tasks/setup-Debian.yml +6 -0
  54. data/vendor/geerlingguy.memcached/tasks/setup-RedHat.yml +3 -0
  55. data/vendor/{bennojoy.memcached/templates/memcached_debian.j2 → geerlingguy.memcached/templates/memcached-Debian.conf.j2} +7 -29
  56. data/vendor/geerlingguy.memcached/templates/memcached-RedHat.conf.j2 +19 -0
  57. data/vendor/geerlingguy.memcached/tests/inventory +1 -0
  58. data/vendor/geerlingguy.memcached/tests/test.yml +5 -0
  59. data/vendor/geerlingguy.memcached/vars/Debian.yml +3 -0
  60. data/vendor/geerlingguy.memcached/vars/RedHat.yml +3 -0
  61. data/vendor/jnv.mosh/meta/.galaxy_install_info +1 -1
  62. data/vendor/jnv.unattended-upgrades/README.md +8 -2
  63. data/vendor/jnv.unattended-upgrades/meta/.galaxy_install_info +1 -1
  64. data/vendor/jnv.unattended-upgrades/tasks/main.yml +5 -0
  65. data/vendor/jnv.unattended-upgrades/tasks/reboot.yml +12 -0
  66. data/vendor/jnv.unattended-upgrades/vars/Debian.yml +1 -1
  67. data/vendor/lxhunter.apt/meta/.galaxy_install_info +1 -1
  68. data/vendor/tersmitten.htop/meta/.galaxy_install_info +1 -1
  69. data/vendor/zzet.rbenv/README.md +10 -10
  70. data/vendor/zzet.rbenv/defaults/main.yml +9 -9
  71. data/vendor/zzet.rbenv/meta/.galaxy_install_info +1 -1
  72. data/vendor/zzet.rbenv/tasks/main.yml +41 -10
  73. metadata +35 -46
  74. data/vendor/ANXS.postgresql/test.yml +0 -8
  75. data/vendor/bennojoy.memcached/README.md +0 -49
  76. data/vendor/bennojoy.memcached/defaults/main.yml +0 -8
  77. data/vendor/bennojoy.memcached/handlers/main.yml +0 -3
  78. data/vendor/bennojoy.memcached/meta/.galaxy_install_info +0 -1
  79. data/vendor/bennojoy.memcached/meta/main.yml +0 -26
  80. data/vendor/bennojoy.memcached/tasks/main.yml +0 -30
  81. data/vendor/bennojoy.memcached/templates/memcached_redhat.j2 +0 -5
  82. data/vendor/bennojoy.memcached/vars/main.yml +0 -14
  83. data/vendor/nodesource.node/Dockerfile +0 -16
  84. data/vendor/nodesource.node/LICENSE.md +0 -11
  85. data/vendor/nodesource.node/README.md +0 -46
  86. data/vendor/nodesource.node/defaults/main.yml +0 -3
  87. data/vendor/nodesource.node/handlers/main.yml +0 -2
  88. data/vendor/nodesource.node/meta/.galaxy_install_info +0 -1
  89. data/vendor/nodesource.node/meta/main.yml +0 -18
  90. data/vendor/nodesource.node/role.yml +0 -6
  91. data/vendor/nodesource.node/tasks/main.yml +0 -26
  92. data/vendor/nodesource.node/templates/etc/apt/preferences.d/deb_nodesource_com_node.pref.2 +0 -5
  93. data/vendor/nodesource.node/tests/localhosts +0 -2
  94. data/vendor/nodesource.node/vars/main.yml +0 -2
  95. data/vendor/williamyeh.nodejs/.gitignore +0 -1
  96. data/vendor/williamyeh.nodejs/LICENSE +0 -22
  97. data/vendor/williamyeh.nodejs/README.md +0 -107
  98. data/vendor/williamyeh.nodejs/Vagrantfile +0 -33
  99. data/vendor/williamyeh.nodejs/circle.yml +0 -32
  100. data/vendor/williamyeh.nodejs/defaults/main.yml +0 -17
  101. data/vendor/williamyeh.nodejs/files/nodesource.gpg.key +0 -52
  102. data/vendor/williamyeh.nodejs/meta/.galaxy_install_info +0 -1
  103. data/vendor/williamyeh.nodejs/meta/main.yml +0 -27
  104. data/vendor/williamyeh.nodejs/tasks/main.yml +0 -19
  105. data/vendor/williamyeh.nodejs/tasks/set-role-variables.yml +0 -15
  106. data/vendor/williamyeh.nodejs/tasks/use-apt.yml +0 -88
  107. data/vendor/williamyeh.nodejs/tasks/use-yum.yml +0 -34
  108. data/vendor/williamyeh.nodejs/test/Dockerfile-centos6 +0 -29
  109. data/vendor/williamyeh.nodejs/test/Dockerfile-centos7 +0 -29
  110. data/vendor/williamyeh.nodejs/test/Dockerfile-debian7 +0 -29
  111. data/vendor/williamyeh.nodejs/test/Dockerfile-debian8 +0 -29
  112. data/vendor/williamyeh.nodejs/test/Dockerfile-ubuntu12.04 +0 -29
  113. data/vendor/williamyeh.nodejs/test/Dockerfile-ubuntu14.04 +0 -29
  114. data/vendor/williamyeh.nodejs/test.yml +0 -12
@@ -1,5 +1,12 @@
1
1
  # file: postgresql/tasks/configure.yml
2
2
 
3
+ - name: PostgreSQL | Drop the data directory | RedHat
4
+ file:
5
+ path: "{{ postgresql_data_directory }}"
6
+ state: absent
7
+ register: pgdata_dir_remove
8
+ when: ansible_os_family == "RedHat" and postgresql_cluster_reset
9
+
3
10
  - name: PostgreSQL | Make sure the postgres data directory exists
4
11
  file:
5
12
  path: "{{postgresql_data_directory}}"
@@ -9,21 +16,58 @@
9
16
  mode: 0700
10
17
  register: pgdata_dir_exist
11
18
 
12
- - name: PostgreSQL | Ensure the locale is generated
19
+ - name: PostgreSQL | Ensure the locale is generated | Debian
20
+ sudo: yes
21
+ locale_gen: name="{{ postgresql_locale }}" state=present
22
+ when: ansible_os_family == "Debian"
23
+
24
+ - name: PostgreSQL | Ensure the locale is generated | RedHat
25
+ sudo: yes
26
+ command: >
27
+ localedef -c -i {{ postgresql_locale_parts[0] }} -f {{ postgresql_locale_parts[1] }}
28
+ {{ postgresql_locale }}
29
+ changed_when: false
30
+ when: ansible_os_family == "RedHat"
31
+
32
+ - name: PostgreSQL | Reset the cluster - drop the existing one | Debian
33
+ shell: pg_dropcluster --stop {{ postgresql_version }} {{ postgresql_cluster_name }}
13
34
  sudo: yes
14
- locale_gen: name={{postgresql_locale}} state=present
35
+ sudo_user: "{{ postgresql_service_user }}"
36
+ when: ansible_os_family == "Debian" and postgresql_cluster_reset and pgdata_dir_exist.changed
15
37
 
16
- - name: PostgreSQL | Reset the cluster - drop the existing one
17
- shell: pg_dropcluster --stop {{postgresql_version}} {{postgresql_cluster_name}}
38
+ - name: PostgreSQL | Reset the cluster - create a new one (with specified encoding and locale) | Debian
39
+ shell: >
40
+ pg_createcluster --start --locale {{ postgresql_locale }}
41
+ -e {{ postgresql_encoding }} -d {{ postgresql_data_directory }}
42
+ {{ postgresql_version }} {{ postgresql_cluster_name }}
18
43
  sudo: yes
19
44
  sudo_user: "{{ postgresql_service_user }}"
20
- when: postgresql_cluster_reset and pgdata_dir_exist.changed
45
+ when: ansible_os_family == "Debian" and postgresql_cluster_reset and pgdata_dir_exist.changed
46
+
47
+ - name: PostgreSQL | Check whether the postgres data directory is initialized
48
+ stat:
49
+ path: "{{ postgresql_data_directory }}/PG_VERSION"
50
+ when: ansible_os_family == "RedHat" and not postgresql_cluster_reset
51
+ register: pgdata_dir_initialized
21
52
 
22
- - name: PostgreSQL | Reset the cluster - create a new one (with specified encoding and locale)
23
- shell: pg_createcluster --start --locale {{postgresql_locale}} -e {{postgresql_encoding}} -d {{postgresql_data_directory}} {{postgresql_version}} {{postgresql_cluster_name}}
53
+ - name: PostgreSQL | Initialize the database | RedHat
54
+ command: >
55
+ {{ postgresql_bin_directory }}/initdb -D {{ postgresql_data_directory }}
56
+ --locale={{ postgresql_locale }} --encoding={{ postgresql_encoding }}
24
57
  sudo: yes
25
58
  sudo_user: "{{ postgresql_service_user }}"
26
- when: postgresql_cluster_reset and pgdata_dir_exist.changed
59
+ when: ansible_os_family == "RedHat" and
60
+ (postgresql_cluster_reset or
61
+ pgdata_dir_exist.changed or
62
+ not pgdata_dir_initialized.stat.exists)
63
+
64
+ - name: PostgreSQL | Ensure configuration directory exists
65
+ file:
66
+ path: "{{ postgresql_conf_directory }}"
67
+ owner: "{{ postgresql_service_user }}"
68
+ group: "{{ postgresql_service_group }}"
69
+ mode: 0750
70
+ state: directory
27
71
 
28
72
  - name: PostgreSQL | Update configuration - pt. 1 (pg_hba.conf)
29
73
  template:
@@ -82,8 +126,30 @@
82
126
  group: "{{ postgresql_service_group }}"
83
127
  mode: 0755
84
128
 
129
+ - name: PostgreSQL | Ensure the systemd directory for PostgreSQL exists | RedHat
130
+ file:
131
+ name: "/etc/systemd/system/postgresql-{{ postgresql_version }}.service.d"
132
+ state: directory
133
+ mode: 0755
134
+ when: ansible_os_family == "RedHat"
135
+
136
+ - name: PostgreSQL | Use the conf directory when starting the Postgres service | RedHat
137
+ template:
138
+ src: etc_systemd_system_postgresql.service.d_custom.conf.j2
139
+ dest: "/etc/systemd/system/postgresql-{{ postgresql_version }}.service.d/custom.conf"
140
+ when: ansible_os_family == "RedHat"
141
+ register: postgresql_systemd_custom_conf
142
+
143
+ - name: PostgreSQL | Ensure the pid directory for PostgreSQL exists
144
+ file:
145
+ name: "{{ postgresql_pid_directory }}"
146
+ state: directory
147
+ owner: "{{ postgresql_service_user }}"
148
+ group: "{{ postgresql_service_group }}"
149
+ mode: u=rwX,g=rwXs,o=rx
150
+
85
151
  - name: PostgreSQL | Restart PostgreSQL
86
152
  service:
87
- name: postgresql
153
+ name: "{{ postgresql_service_name }}"
88
154
  state: restarted
89
- when: postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed or postgresql_configuration_pt3.changed
155
+ when: postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed or postgresql_configuration_pt3.changed or postgresql_systemd_custom_conf.changed
@@ -2,13 +2,13 @@
2
2
 
3
3
  - name: PostgreSQL | Ensure PostgreSQL is running
4
4
  service:
5
- name: postgresql
5
+ name: "{{ postgresql_service_name }}"
6
6
  state: started
7
7
 
8
8
  - name: PostgreSQL | Make sure the PostgreSQL databases are present
9
9
  postgresql_db:
10
10
  name: "{{item.name}}"
11
- owner: "{{postgresql_database_owner}}"
11
+ owner: "{{ item.owner | default(postgresql_database_owner) }}"
12
12
  encoding: "{{postgresql_encoding}}"
13
13
  lc_collate: "{{postgresql_locale}}"
14
14
  lc_ctype: "{{postgresql_locale}}"
@@ -21,10 +21,20 @@
21
21
  with_items: postgresql_databases
22
22
  when: postgresql_databases|length > 0
23
23
 
24
+ - name: PostgreSQL | Add extensions to the databases
25
+ shell: "psql {{item.0.db}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS {{ item.1 }};'"
26
+ sudo: yes
27
+ sudo_user: "{{postgresql_admin_user}}"
28
+ with_subelements:
29
+ - postgresql_database_extensions
30
+ - extensions
31
+ register: result
32
+ changed_when: "'NOTICE' not in result.stderr"
33
+
24
34
  - name: PostgreSQL | Add hstore to the databases with the requirement
25
35
  sudo: yes
26
36
  sudo_user: "{{ postgresql_service_user }}"
27
- shell: "psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
37
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
28
38
  with_items: postgresql_databases
29
39
  register: hstore_ext_result
30
40
  failed_when: hstore_ext_result.rc != 0 and ("already exists, skipping" not in hstore_ext_result.stderr)
@@ -34,7 +44,7 @@
34
44
  - name: PostgreSQL | Add uuid-ossp to the database with the requirement
35
45
  sudo: yes
36
46
  sudo_user: "{{ postgresql_service_user }}"
37
- shell: "psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
47
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
38
48
  with_items: postgresql_databases
39
49
  register: uuid_ext_result
40
50
  failed_when: uuid_ext_result.rc != 0 and ("already exists, skipping" not in uuid_ext_result.stderr)
@@ -44,35 +54,35 @@
44
54
  - name: PostgreSQL | Add postgis to the databases with the requirement
45
55
  sudo: yes
46
56
  sudo_user: "{{ postgresql_service_user }}"
47
- shell: "psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'&&psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'"
57
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'&&psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'"
48
58
  with_items: postgresql_databases
49
59
  when: item.gis is defined and item.gis
50
60
 
51
- - name: postgresql | add cube to the database with the requirement
61
+ - name: PostgreSQL | add cube to the database with the requirement
52
62
  sudo: yes
53
63
  sudo_user: "{{ postgresql_service_user }}"
54
- shell: "psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists cube;'"
64
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists cube;'"
55
65
  with_items: postgresql_databases
56
66
  when: item.cube is defined and item.cube
57
67
 
58
68
  - name: PostgreSQL | Add plpgsql to the database with the requirement
59
69
  sudo: yes
60
70
  sudo_user: "{{ postgresql_service_user }}"
61
- shell: "psql {{item.name}} --username {{ postgresql_admin_user }} -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;'"
71
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;'"
62
72
  with_items: postgresql_databases
63
73
  when: item.plpgsql is defined and item.plpgsql
64
74
 
65
- - name: postgresql | add earthdistance to the database with the requirement
75
+ - name: PostgreSQL | add earthdistance to the database with the requirement
66
76
  sudo: yes
67
77
  sudo_user: "{{ postgresql_service_user }}"
68
- shell: "psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists earthdistance;'"
78
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{ postgresql_admin_user }} -c 'create extension if not exists earthdistance;'"
69
79
  with_items: postgresql_databases
70
80
  when: item.earthdistance is defined and item.earthdistance
71
81
 
72
82
  - name: PostgreSQL | Add citext to the database with the requirement
73
83
  sudo: yes
74
84
  sudo_user: "{{ postgresql_service_user }}"
75
- shell: "psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS citext;'"
85
+ shell: "{{ postgresql_bin_directory}}/psql {{item.name}} --username {{postgresql_admin_user}} -c 'CREATE EXTENSION IF NOT EXISTS citext;'"
76
86
  with_items: postgresql_databases
77
87
  register: citext_ext_result
78
88
  failed_when: citext_ext_result.rc != 0 and ("already exists, skipping" not in citext_ext_result.stderr)
@@ -1,11 +1,19 @@
1
1
  # file: postgresql/tasks/extensions/contrib.yml
2
2
 
3
- - name: PostgreSQL | Extensions | Make sure the postgres contrib extensions are installed
3
+ - name: PostgreSQL | Extensions | Make sure the postgres contrib extensions are installed | Debian
4
4
  apt:
5
5
  name: "postgresql-contrib-{{postgresql_version}}"
6
6
  state: present
7
7
  update_cache: yes
8
8
  cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
9
+ when: ansible_os_family == "Debian"
9
10
  notify:
10
11
  - restart postgresql
11
12
 
13
+ - name: PostgreSQL | Extensions | Make sure the postgres contrib extensions are installed | RedHat
14
+ yum:
15
+ name: "postgresql{{postgresql_version_terse}}-contrib"
16
+ state: present
17
+ when: ansible_os_family == "RedHat"
18
+ notify:
19
+ - restart postgresql
@@ -40,7 +40,7 @@
40
40
  state: present
41
41
  update_cache: yes
42
42
  cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
43
- environment: postgresql_env
43
+ environment: "{{postgresql_env}}"
44
44
  with_items:
45
45
  - "postgresql-{{postgresql_version}}"
46
46
  - "postgresql-client-{{postgresql_version}}"
@@ -52,5 +52,5 @@
52
52
  state: present
53
53
  update_cache: yes
54
54
  cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
55
- environment: postgresql_env
55
+ environment: "{{postgresql_env}}"
56
56
  when: postgresql_pgtune
@@ -0,0 +1,36 @@
1
+ # file: postgresql/tasks/install_yum.yml
2
+
3
+ # The standard ca-certs are needed because without them apt_key will fail to
4
+ # validate www.postgresql.org (or probably any other source).
5
+ - name: PostgreSQL | Make sure the CA certificates are available
6
+ yum:
7
+ name: ca-certificates
8
+ state: present
9
+
10
+ - name: PostgreSQL | Add PostgreSQL repository
11
+ yum:
12
+ name: "{{ postgresql_yum_repository_url }}"
13
+ state: present
14
+
15
+ - name: PostgreSQL | Make sure the dependencies are installed
16
+ yum:
17
+ name: "{{ item }}"
18
+ state: present
19
+ update_cache: yes
20
+ with_items: ["python-psycopg2", "python-pycurl", "glibc-common"]
21
+
22
+ - name: PostgreSQL | Install PostgreSQL
23
+ yum:
24
+ name: "{{ item }}"
25
+ state: present
26
+ environment: postgresql_env
27
+ with_items:
28
+ - "postgresql{{ postgresql_version_terse }}-server"
29
+ - "postgresql{{ postgresql_version_terse }}"
30
+
31
+ - name: PostgreSQL | PGTune
32
+ yum:
33
+ name: pgtune
34
+ state: present
35
+ environment: postgresql_env
36
+ when: postgresql_pgtune
@@ -1,6 +1,17 @@
1
1
  # file: postgresql/tasks/main.yml
2
2
 
3
+ - include_vars: "{{ item }}"
4
+ with_first_found:
5
+ - "../vars/{{ ansible_os_family }}.yml"
6
+ - "../vars/empty.yml"
7
+ tags: [always]
8
+
3
9
  - include: install.yml
10
+ when: ansible_pkg_mgr == "apt"
11
+ tags: [postgresql, postgresql-install]
12
+
13
+ - include: install_yum.yml
14
+ when: ansible_pkg_mgr == "yum"
4
15
  tags: [postgresql, postgresql-install]
5
16
 
6
17
  - include: extensions.yml
@@ -2,13 +2,14 @@
2
2
 
3
3
  - name: PostgreSQL | Ensure PostgreSQL is running
4
4
  service:
5
- name: postgresql
5
+ name: "{{ postgresql_service_name }}"
6
6
  state: started
7
7
 
8
8
  - name: PostgreSQL | Make sure the PostgreSQL users are present
9
9
  postgresql_user:
10
10
  name: "{{item.name}}"
11
11
  password: "{{item.pass | default('pass')}}"
12
+ encrypted: "{{ item.encrypted | default(omit) }}"
12
13
  port: "{{postgresql_port}}"
13
14
  state: present
14
15
  login_user: "{{postgresql_admin_user}}"
@@ -0,0 +1,21 @@
1
+ How to add a new PostgreSQL version
2
+ ===================================
3
+
4
+ 1) Download the Debian package 'postgresql-9.X_[...].deb' from
5
+ http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.X/
6
+
7
+ 2) Extract the 'usr/share/postgresql/9.1/postgresql.conf.sample' file
8
+ and save it under the 'templates' role directory
9
+ => templates/postgresql.conf.9.{X}.orig
10
+
11
+ 3) Check the difference between another version:
12
+ => vimdiff postgresql.conf.9.{X-1}.orig postgresql.conf.9.{X}.orig
13
+
14
+ 4) Copy an existing template:
15
+ => cp postgresql.conf.9.{X-1}.j2 postgresql.conf.9.{X}.j2
16
+
17
+ 5) Update the new template following the major differences.
18
+
19
+ 5) If there are new options or some of them removed, update the 'default/main.yml' file and add a "(>= 9.X)" or "(<= 9.X)" comment to them.
20
+
21
+ 6) Update the '.travis.yml' file to test its new version.
@@ -0,0 +1,11 @@
1
+ # {{ ansible_managed }}
2
+ # Systemd unit file override to specify user/group as well as separate config
3
+ # and data directories.
4
+ [Service]
5
+ User={{ postgresql_service_user }}
6
+ Group={{ postgresql_service_group }}
7
+
8
+ Environment=PGDATA={{ postgresql_conf_directory }}
9
+
10
+ ExecStartPre=
11
+ ExecStartPre={{ postgresql_bin_directory }}/postgresql{{ postgresql_version_terse }}-check-db-dir {{ postgresql_data_directory }}
@@ -18,7 +18,9 @@
18
18
 
19
19
  # Default:
20
20
  {% for connection in postgresql_pg_hba_default %}
21
+ {% if connection.comment is defined %}
21
22
  # {{connection.comment}}
23
+ {% endif %}
22
24
  {{connection.type}} {{connection.database}} {{connection.user}} {{connection.address}} {{connection.method}}
23
25
  {% endfor %}
24
26
 
@@ -34,6 +36,8 @@ host all all {{host}} trust
34
36
 
35
37
  # User custom
36
38
  {% for connection in postgresql_pg_hba_custom %}
39
+ {% if connection.comment is defined %}
37
40
  # {{connection.comment}}
41
+ {% endif %}
38
42
  {{connection.type}} {{connection.database}} {{connection.user}} {{connection.address}} {{connection.method}}
39
43
  {% endfor %}