-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
132 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
|
||
- name: pre Install demo packages ubuntu | ||
apt: | ||
name="{{item}}" | ||
update_cache=yes | ||
cache_valid_time=3600 | ||
with_items: | ||
- "git" | ||
- "postgresql" | ||
- "python-psycopg2" | ||
- "vim" | ||
- "curl" | ||
# this should fail if no match for postgreql path or more than on match | ||
- name: find postgresql path | ||
find: | ||
paths="/etc/postgresql/" | ||
patterns="9.*" | ||
file_type="directory" | ||
register: find_reg | ||
failed_when: find_reg.matched != 1 | ||
|
||
- name: pre Configure postgresql hba.conf | ||
lineinfile: | ||
dest="{{ find_reg.files[0].path }}/main/pg_hba.conf" | ||
insertafter="EOF" | ||
line="host all all 0.0.0.0/0 md5" | ||
register: postgresql_conf_2 | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=restarted | ||
when: postgresql_conf_1 | changed or postgresql_conf_2 | changed | ||
|
||
- name: pre Create postgresql db | ||
postgresql_db: | ||
name=concourse | ||
become_user: postgres | ||
|
||
- name: pre Create postgresql user | ||
postgresql_user: | ||
db=concourse | ||
name=concourseci | ||
password=conpass | ||
become_user: postgres | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,7 @@ | ||
--- | ||
|
||
- name: pre Install demo packages | ||
apt: | ||
name="{{item}}" | ||
update_cache=yes | ||
cache_valid_time=3600 | ||
with_items: | ||
- "git" | ||
- "postgresql" | ||
- "python-psycopg2" | ||
- "vim" | ||
- "curl" | ||
- include: redhat.yml | ||
when: "{{ ansible_os_family == 'RedHat' }}" | ||
|
||
# this should fail if no match for postgreql path or more than on match | ||
- name: find postgresql path | ||
find: | ||
paths="/etc/postgresql/" | ||
patterns="9.*" | ||
file_type="directory" | ||
register: find_reg | ||
failed_when: find_reg.matched != 1 | ||
|
||
- name: pre Configure postgresql | ||
lineinfile: | ||
dest="{{ find_reg.files[0].path }}/main/postgresql.conf" | ||
regexp='^listen_addresses' | ||
line="listen_addresses = '*'" | ||
register: postgresql_conf_1 | ||
|
||
- name: pre Configure postgresql hba.conf | ||
lineinfile: | ||
dest="{{ find_reg.files[0].path }}/main/pg_hba.conf" | ||
insertafter="EOF" | ||
line="host all all 0.0.0.0/0 md5" | ||
register: postgresql_conf_2 | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=restarted | ||
when: postgresql_conf_1 | changed or postgresql_conf_2 | changed | ||
|
||
- name: pre Create postgresql db | ||
postgresql_db: | ||
name=concourse | ||
become_user: postgres | ||
|
||
- name: pre Create postgresql user | ||
postgresql_user: | ||
db=concourse | ||
name=concourseci | ||
password=conpass | ||
become_user: postgres | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=started | ||
- include: debian.yml | ||
when: "{{ ansible_os_family == 'Debian' }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
|
||
- name: pre Install demo packages centos | ||
yum: | ||
name="{{item}}" | ||
with_items: | ||
- "git" | ||
- "postgresql-server" | ||
- "postgresql-contrib" | ||
- "vim" | ||
- "curl" | ||
|
||
- name: init postgresql centos | ||
shell: postgresql-setup initdb | ||
become: True | ||
changed_when: False | ||
|
||
- name: pre Configure postgresql hba.conf | ||
lineinfile: | ||
dest="/var/lib/pgsql/data/pg_hba.conf" | ||
insertafter="EOF" | ||
line="host all all 0.0.0.0/0 md5" | ||
register: postgresql_conf_2 | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=restarted | ||
when: postgresql_conf_1 | changed or postgresql_conf_2 | changed | ||
|
||
- name: pre Create postgresql db | ||
postgresql_db: | ||
name=concourse | ||
become_user: postgres | ||
|
||
- name: pre Create postgresql user | ||
postgresql_user: | ||
db=concourse | ||
name=concourseci | ||
password=conpass | ||
become_user: postgres | ||
|
||
- name: pre Service postgresql | ||
service: | ||
name=postgresql | ||
state=started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters