Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
7329bcde
Commit
7329bcde
authored
Dec 01, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New integration tests for postgresql
parent
6570a6c6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
127 additions
and
0 deletions
+127
-0
test/integration/destructive.yml
+1
-0
test/integration/roles/setup_postgresql_db/defaults/main.yml
+5
-0
test/integration/roles/setup_postgresql_db/files/pg_hba.conf
+10
-0
test/integration/roles/setup_postgresql_db/tasks/main.yml
+71
-0
test/integration/roles/setup_postgresql_db/vars/Ubuntu-12.yml
+11
-0
test/integration/roles/setup_postgresql_db/vars/Ubuntu-14.yml
+10
-0
test/integration/roles/setup_postgresql_db/vars/default.yml
+8
-0
test/integration/roles/test_postgresql/defaults/main.yml
+8
-0
test/integration/roles/test_postgresql/meta/main.yml
+3
-0
test/integration/roles/test_postgresql/tasks/main.yml
+0
-0
No files found.
test/integration/destructive.yml
View file @
7329bcde
...
...
@@ -9,6 +9,7 @@
-
{
role
:
test_yum
,
tags
:
test_yum
}
-
{
role
:
test_apt
,
tags
:
test_apt
}
-
{
role
:
test_apt_repository
,
tags
:
test_apt_repository
}
-
{
role
:
test_postgresql
,
tags
:
test_postgresql
}
-
{
role
:
test_mysql_db
,
tags
:
test_mysql_db
}
-
{
role
:
test_mysql_user
,
tags
:
test_mysql_user
}
-
{
role
:
test_mysql_variables
,
tags
:
test_mysql_variables
}
test/integration/roles/setup_postgresql_db/defaults/main.yml
0 → 100644
View file @
7329bcde
postgresql_service
:
postgresql
postgresql_packages
:
-
postgresql-server
-
python-psycopg2
test/integration/roles/setup_postgresql_db/files/pg_hba.conf
0 → 100644
View file @
7329bcde
# !!! This file managed by Ansible. Any local changes may be overwritten. !!!
# Database administrative login by UNIX sockets
# note: you may wish to restrict this further later
local
all
postgres
trust
# TYPE DATABASE USER CIDR-ADDRESS METHOD
local
all
all
md5
host
all
all
127
.
0
.
0
.
1
/
32
md5
host
all
all
::
1
/
128
md5
test/integration/roles/setup_postgresql_db/tasks/main.yml
0 → 100644
View file @
7329bcde
-
include_vars
:
'
{{
item
}}'
with_first_found
:
-
files
:
-
'
{{
ansible_distribution
}}-{{
ansible_distribution_major_version
}}.yml'
-
'
{{
ansible_distribution
}}-{{
ansible_distribution_version
}}.yml'
-
'
{{
ansible_os_family
}}.yml'
-
'
default.yml'
paths
:
'
../vars'
# Make sure we start fresh
-
name
:
remove rpm dependencies for postgresql test
yum
:
name={{ item }} state=absent
with_items
:
postgresql_packages
when
:
ansible_pkg_mgr == 'yum'
-
name
:
remove dpkg dependencies for postgresql test
apt
:
name={{ item }} state=absent
with_items
:
postgresql_packages
when
:
ansible_pkg_mgr == 'apt'
-
name
:
remove old db (red hat)
command
:
rm -rf "{{ pg_dir }}"
ignore_errors
:
True
when
:
ansible_os_family == "RedHat"
# Theoretically, pg_dropcluster should work but it doesn't so rm files
-
name
:
remove old db config (debian)
command
:
rm -rf /etc/postgresql
ignore_errors
:
True
when
:
ansible_os_family == "Debian"
-
name
:
remove old db files (debian)
command
:
rm -rf /var/lib/postgresql
ignore_errors
:
True
when
:
ansible_os_family == "Debian"
-
name
:
install rpm dependencies for postgresql test
yum
:
name={{ item }} state=latest
with_items
:
postgresql_packages
when
:
ansible_pkg_mgr == 'yum'
-
name
:
install dpkg dependencies for postgresql test
apt
:
name={{ item }} state=latest
with_items
:
postgresql_packages
when
:
ansible_pkg_mgr == 'apt'
-
name
:
Initialize postgres (systemd)
command
:
postgresql-setup initdb
when
:
ansible_distribution == "Fedora" or (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7)
-
name
:
Initialize postgres (sysv)
command
:
/sbin/service postgresql initdb
when
:
ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 6
-
name
:
Iniitalize postgres (upstart)
command
:
/usr/bin/pg_createcluster {{ pg_ver }} main
when
:
ansible_os_family == 'Debian'
-
name
:
Copy pg_hba into place
copy
:
src=pg_hba.conf dest="{{ pg_hba_location }}" owner="postgres" group="root" mode="0644"
-
name
:
Generate locale on Debian systems
command
:
locale-gen pt_BR
when
:
ansible_os_family == 'Debian'
-
name
:
Generate locale on Debian systems
command
:
locale-gen es_MX
when
:
ansible_os_family == 'Debian'
-
name
:
restart postgresql service
service
:
name={{ postgresql_service }} state=restarted
test/integration/roles/setup_postgresql_db/vars/Ubuntu-12.yml
0 → 100644
View file @
7329bcde
postgresql_service
:
"
postgresql"
postgresql_packages
:
-
"
postgresql"
-
"
postgresql-common"
-
"
python-psycopg2"
pg_hba_location
:
"
/etc/postgresql/9.1/main/pg_hba.conf"
pg_dir
:
"
/var/lib/postgresql/9.1/main"
pg_ver
:
9.1
test/integration/roles/setup_postgresql_db/vars/Ubuntu-14.yml
0 → 100644
View file @
7329bcde
postgresql_service
:
"
postgresql"
postgresql_packages
:
-
"
postgresql"
-
"
postgresql-common"
-
"
python-psycopg2"
pg_hba_location
:
"
/etc/postgresql/9.3/main/pg_hba.conf"
pg_dir
:
"
/var/lib/postgresql/9.3/main"
pg_ver
:
9.3
test/integration/roles/setup_postgresql_db/vars/default.yml
0 → 100644
View file @
7329bcde
postgresql_service
:
"
postgresql"
postgresql_packages
:
-
"
postgresql-server"
-
"
python-psycopg2"
pg_hba_location
:
"
/var/lib/pgsql/data/pg_hba.conf"
pg_dir
:
"
/var/lib/pgsql/data"
test/integration/roles/test_postgresql/defaults/main.yml
0 → 100644
View file @
7329bcde
---
# defaults file for test_postgresql_db
db_name
:
'
ansible_db'
db_user1
:
'
ansible_db_user1'
db_user2
:
'
ansible_db_user2'
tmp_dir
:
'
/tmp'
test/integration/roles/test_postgresql/meta/main.yml
0 → 100644
View file @
7329bcde
---
dependencies
:
-
setup_postgresql_db
test/integration/roles/test_postgresql/tasks/main.yml
0 → 100644
View file @
7329bcde
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment