diff --git a/test/integration/roles/setup_postgresql_db/tasks/main.yml b/test/integration/roles/setup_postgresql_db/tasks/main.yml index 38bcd50dcc..c49eede664 100644 --- a/test/integration/roles/setup_postgresql_db/tasks/main.yml +++ b/test/integration/roles/setup_postgresql_db/tasks/main.yml @@ -52,15 +52,15 @@ loop_var: postgresql_package_item when: ansible_pkg_mgr == 'apt' -- name: Initialize postgres (systemd) +- name: Initialize postgres (RedHat 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) +- name: Initialize postgres (RedHat sysv) command: /sbin/service postgresql initdb when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 6 -- name: Iniitalize postgres (upstart) +- name: Iniitalize postgres (Debian) command: /usr/bin/pg_createcluster {{ pg_ver }} main # Sometimes package install creates the db cluster, sometimes this step is needed ignore_errors: True diff --git a/test/integration/roles/setup_postgresql_db/vars/Debian-8.yml b/test/integration/roles/setup_postgresql_db/vars/Debian-8.yml new file mode 100644 index 0000000000..f829bd1996 --- /dev/null +++ b/test/integration/roles/setup_postgresql_db/vars/Debian-8.yml @@ -0,0 +1,10 @@ +postgresql_service: "postgresql" + +postgresql_packages: + - "postgresql" + - "postgresql-common" + - "python-psycopg2" + +pg_hba_location: "/etc/postgresql/9.4/main/pg_hba.conf" +pg_dir: "/var/lib/postgresql/9.4/main" +pg_ver: 9.4 diff --git a/test/integration/roles/test_apt/tasks/apt.yml b/test/integration/roles/test_apt/tasks/apt.yml index 5d331b192d..201404f647 100644 --- a/test/integration/roles/test_apt/tasks/apt.yml +++ b/test/integration/roles/test_apt/tasks/apt.yml @@ -21,7 +21,7 @@ register: apt_result - name: check hello with dpkg - shell: dpkg --get-selections | fgrep hello + shell: dpkg-query -l hello failed_when: False register: dpkg_result @@ -47,7 +47,7 @@ register: apt_result - name: check hello with dpkg - shell: dpkg --get-selections | fgrep hello + shell: dpkg-query -l hello failed_when: False register: dpkg_result @@ -89,7 +89,7 @@ register: apt_result - name: check hello with wildcard with dpkg - shell: dpkg --get-selections | fgrep hello + shell: dpkg-query -l hello failed_when: False register: dpkg_result @@ -103,10 +103,10 @@ - "dpkg_result.rc == 0" - name: check hello version - shell: dpkg -s hello | grep Version | sed -r 's/Version:\s+([a-zA-Z0-9.-]+)\s*$/\1/' + shell: dpkg -s hello | grep Version | awk '{print $2}' register: hello_version - name: check hello architecture - shell: dpkg -s hello | grep Architecture | sed -r 's/Architecture:\s+([a-zA-Z0-9.-]+)\s*$/\1/' + shell: dpkg -s hello | grep Architecture | awk '{print $2}' register: hello_architecture - name: uninstall hello with apt diff --git a/test/integration/roles/test_apt_repository/tasks/main.yml b/test/integration/roles/test_apt_repository/tasks/main.yml index 8a16a061bd..38ae8f0447 100644 --- a/test/integration/roles/test_apt_repository/tasks/main.yml +++ b/test/integration/roles/test_apt_repository/tasks/main.yml @@ -17,5 +17,5 @@ # along with Ansible. If not, see . - include: 'apt.yml' - when: ansible_distribution in ('Ubuntu', 'Debian') + when: ansible_distribution in ('Ubuntu') diff --git a/test/integration/roles/test_service/tasks/main.yml b/test/integration/roles/test_service/tasks/main.yml index 8b61d62143..de7c29a9cb 100644 --- a/test/integration/roles/test_service/tasks/main.yml +++ b/test/integration/roles/test_service/tasks/main.yml @@ -13,7 +13,7 @@ - include: 'sysv_setup.yml' when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and (ansible_distribution_version|version_compare('6', '>=') and ansible_distribution_version|version_compare('7', '<')) - include: 'systemd_setup.yml' - when: (ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and (ansible_distribution_version|version_compare('7', '>=') and ansible_distribution_version|version_compare('8', '<'))) or ansible_distribution == 'Fedora' or (ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('15.04', '>=')) + when: (ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and (ansible_distribution_version|version_compare('7', '>=') and ansible_distribution_version|version_compare('8', '<'))) or ansible_distribution == 'Fedora' or (ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('15.04', '>=')) or (ansible_distribution == 'Debian' and ansible_distribution_version|version_compare('8', '>=')) - include: 'upstart_setup.yml' when: ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('15.04', '<') diff --git a/test/integration/roles/test_service/tasks/systemd_setup.yml b/test/integration/roles/test_service/tasks/systemd_setup.yml index 4a3a81a4a6..d1428149d0 100644 --- a/test/integration/roles/test_service/tasks/systemd_setup.yml +++ b/test/integration/roles/test_service/tasks/systemd_setup.yml @@ -1,18 +1,18 @@ - name: install the systemd unit file - copy: src=ansible.systemd dest=/usr/lib/systemd/system/ansible_test.service + copy: src=ansible.systemd dest=/etc/systemd/system/ansible_test.service register: install_systemd_result - name: install a broken systemd unit file - file: src=ansible_test.service path=/usr/lib/systemd/system/ansible_test_broken.service state=link + file: src=ansible_test.service path=/etc/systemd/system/ansible_test_broken.service state=link register: install_broken_systemd_result - name: assert that the systemd unit file was installed assert: that: - - "install_systemd_result.dest == '/usr/lib/systemd/system/ansible_test.service'" + - "install_systemd_result.dest == '/etc/systemd/system/ansible_test.service'" - "install_systemd_result.state == 'file'" - "install_systemd_result.mode == '0644'" - "install_systemd_result.checksum == 'ca4b413fdf3cb2002f51893b9e42d2e449ec5afb'" - - "install_broken_systemd_result.dest == '/usr/lib/systemd/system/ansible_test_broken.service'" + - "install_broken_systemd_result.dest == '/etc/systemd/system/ansible_test_broken.service'" - "install_broken_systemd_result.state == 'link'"