diff --git a/README.md b/README.md index 0b79e48..e898019 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,11 @@ following configuration: * **Debian:** Ensure java_packages has a debian java package in it, i.e. openjdk-7-jre-headless * **RedHat:** Ensure java_packages has a debian java package in it, i.e. java-1.7.0-openjdk, had to adjust role to include RedHat.yml in main.yml to work. +If you choose to use a database then please ensure it is installed before executing this role. The following roles have been used to create databses: + + * **Ubuntu 12.04 & 14.04/PostgreSQL:** [postgresql](https://galaxy.ansible.com/list#/roles/512) + * **Centos 6.5 & 7.0/PostgreSQL:** [postgresql-on-el6](https://galaxy.ansible.com/list#/roles/766) (with tweeks, watch this space for updates) + ## License Licensed under the MIT License. See the LICENSE file for details. diff --git a/tests/postgresql_test.yml b/tests/postgresql_debian_test.yml similarity index 88% rename from tests/postgresql_test.yml rename to tests/postgresql_debian_test.yml index fe093b9..3d620d8 100644 --- a/tests/postgresql_test.yml +++ b/tests/postgresql_debian_test.yml @@ -24,7 +24,8 @@ - libselinux-python roles: - - role: neel.postgresql + - ansible-java-role + - role: postgresql postgresql_databases: - name: rundeck postgresql_users: @@ -37,9 +38,10 @@ name: rundeck db: rundeck priv: "ALL" - - role: neel.rundeck + - role: ansible-rundeck rundeck_database_type: postgresql + rundeck_database_pass: rund3ck post_tasks: - name: Verification | - shell: "ps aux | grep -v grep | grep rundeck -c | if [ `awk '{print $1}'` -eq 0 ]; then echo 'rundeck service is not running'; fi;" + shell: "ps aux | grep -v grep | grep rundeck -c | if [ `awk '{print $1}'` -eq 0 ]; then echo 'rundeck service is not running'; else echo 'ok'; fi;" diff --git a/tests/postgresql_redhat_test.yml b/tests/postgresql_redhat_test.yml new file mode 100644 index 0000000..aa5ebb2 --- /dev/null +++ b/tests/postgresql_redhat_test.yml @@ -0,0 +1,48 @@ +--- +- name: test default values deployment + hosts: rundeck-servers + sudo: yes + + pre_tasks: + - name: Setup | Update apt-cache + apt: + update_cache: yes + when: ansible_os_family == 'Debian' + + - name: Setup | Correct locale + command: locale-gen en_GB.UTF-8 + when: ansible_os_family == 'Debian' and ansible_distribution_version|version_compare('14.04', '==') + sudo: yes + + - name: Setup | Install supporting packages + yum: + name: "{{ item }}" + state: present + when: ansible_os_family == 'RedHat' + sudo: yes + with_items: + - libselinux-python + + roles: + - ansible-java-role + - role: ansible-postgresql-on-el6 + postgresql_databases: + - + name: rundeck + owner: postgres + template: template0 + encoding: "{{ postgresql_encoding }}" + collate: "{{ postgresql_locale }}" + ctype: "{{ postgresql_locale }}" + postgresql_users: + - + name: rundeck + pass: rund3ck + flags: "LOGIN,SUPERUSER" + - role: ansible-rundeck + rundeck_database_type: postgresql + rundeck_database_pass: rund3ck + + post_tasks: + - name: Verification | + shell: "ps aux | grep -v grep | grep rundeck -c | if [ `awk '{print $1}'` -eq 0 ]; then echo 'rundeck service is not running'; else echo 'ok'; fi;"