From ddf2129e5d6fc8ccbc315f97eeb0dbeed4a25c96 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 10 Nov 2017 03:14:25 -0600 Subject: [PATCH 1/3] ubuntu-17.yml --- roles/postgresql/tasks/main.yml | 11 +++-------- scripts/local_facts.fact | 1 + vars/ubuntu-17.yml | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 vars/ubuntu-17.yml diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index 7574c2fc9..e1b3a1ccc 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -44,12 +44,7 @@ - name: Initialize the postgres db command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" creates=/library/pgsql-iiab/pg_hba.conf - when: is_debian - -- name: Initialize the postgres db - command: su - postgres -c "/usr/lib/postgresql/9.5/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" - creates=/library/pgsql-iiab/pg_hba.conf - when: is_ubuntu + when: is_debuntu - name: Initialize the postgres db command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" @@ -80,8 +75,8 @@ enabled=yes when: postgresql_enabled -- name: Stop and disable postgresql service if not postgresql_enabled - service: name=postgresql +- name: Stop and disable postgresql-iiab service if not postgresql_enabled + service: name=postgresql-iiab state=stopped enabled=no when: not postgresql_enabled diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 54863bcd7..490fa2608 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -12,6 +12,7 @@ case $OS_VER in "debian-8" | \ "debian-9" | \ "ubuntu-16" | \ +"ubuntu-17" | \ "centos-7" | \ "raspbian-8"| \ "raspbian-9") diff --git a/vars/ubuntu-17.yml b/vars/ubuntu-17.yml new file mode 100644 index 000000000..73e4405b6 --- /dev/null +++ b/vars/ubuntu-17.yml @@ -0,0 +1,22 @@ +is_debuntu: True +is_ubuntu: True +dns_service: bind9 +dns_user: bind +dhcp_service: isc-dhcp-server +proxy: squid +proxy_user: proxy +apache_service: apache2 +apache_user: www-data +apache_config_dir: apache2/sites-available +apache_log_dir: /var/log/apache2 +smb_service: smbd +nmb_service: nmbd +systemctl_program: /bin/systemctl +mysql_service: mysql +apache_log: /var/log/apache2/access.log +# cups lp module not available in raspbian, causes systemd-modueles-load to fail +# which in turn cause netfilter-persistent to fail, which is essential +sshd_service: ssh +php_version: 7.0 +postgresql_version: 9.6 +systemd_location: /lib/systemd/system From f04c8894ccc0ddf2ceb292c96d12cf9904bed8df Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 10 Nov 2017 03:24:54 -0600 Subject: [PATCH 2/3] cups --- vars/debian-8.yml | 3 --- vars/debian-9.yml | 3 --- vars/raspbian-8.yml | 3 --- vars/raspbian-9.yml | 3 --- vars/ubuntu-16.yml | 3 --- vars/ubuntu-17.yml | 3 +-- 6 files changed, 1 insertion(+), 17 deletions(-) diff --git a/vars/debian-8.yml b/vars/debian-8.yml index bf15b534b..5b6153ce4 100644 --- a/vars/debian-8.yml +++ b/vars/debian-8.yml @@ -14,9 +14,6 @@ nmb_service: nmbd systemctl_program: /bin/systemctl mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential -cups_install: True sshd_service: ssh php_version: 5 postgresql_version: 9.4 diff --git a/vars/debian-9.yml b/vars/debian-9.yml index 4145ed60a..a945d779b 100644 --- a/vars/debian-9.yml +++ b/vars/debian-9.yml @@ -15,9 +15,6 @@ nmb_service: nmbd systemctl_program: /bin/systemctl mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential -cups_install: True sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 diff --git a/vars/raspbian-8.yml b/vars/raspbian-8.yml index 0a61c04a1..1e1e42706 100644 --- a/vars/raspbian-8.yml +++ b/vars/raspbian-8.yml @@ -16,9 +16,6 @@ nmb_service: nmbd systemctl_program: /bin/systemctl mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential -cups_install: True sshd_service: ssh php_version: 5 postgresql_version: 9.4 diff --git a/vars/raspbian-9.yml b/vars/raspbian-9.yml index ad0e0a408..bab3f83e0 100644 --- a/vars/raspbian-9.yml +++ b/vars/raspbian-9.yml @@ -17,9 +17,6 @@ nmb_service: nmbd systemctl_program: /bin/systemctl mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential -cups_install: False sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml index be62d0718..013e385a2 100644 --- a/vars/ubuntu-16.yml +++ b/vars/ubuntu-16.yml @@ -14,9 +14,6 @@ nmb_service: nmbd systemctl_program: /bin/systemctl mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential -cups_install: True sshd_service: ssh php_version: 7.0 postgresql_version: 9.5 diff --git a/vars/ubuntu-17.yml b/vars/ubuntu-17.yml index 73e4405b6..2fae439e4 100644 --- a/vars/ubuntu-17.yml +++ b/vars/ubuntu-17.yml @@ -12,10 +12,9 @@ apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd systemctl_program: /bin/systemctl +# issue raised mysql_service: mysql apache_log: /var/log/apache2/access.log -# cups lp module not available in raspbian, causes systemd-modueles-load to fail -# which in turn cause netfilter-persistent to fail, which is essential sshd_service: ssh php_version: 7.0 postgresql_version: 9.6 From 95409fdfffdb85ada443c4bd090e6d9592964fc7 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 10 Nov 2017 13:01:22 -0600 Subject: [PATCH 3/3] move dhcpcd detection to local_facts to clean up logging --- roles/network/tasks/detected_network.yml | 7 +------ scripts/local_facts.fact | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index 2bc744d07..1d4827f99 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -19,14 +19,9 @@ include_tasks: detected_redhat.yml when: is_redhat -- name: Check to see if dhcpcd is installed and active - Can Fail - shell: systemctl is-enabled dhcpcd - register: dhcpcd_test - ignore_errors: True - - name: Setting dhcpcd_test results set_fact: - dhcpcd_result: "{{ dhcpcd_test.stdout }}" + dhcpcd_result: '{{ ansible_local.local_facts.dhcpcd }}' - name: Check /etc/network/interfaces for gateway shell: grep {{ device_gw }} /etc/network/interfaces | wc -l diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 490fa2608..67c274826 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -5,6 +5,7 @@ VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2` VERSION_ID=${VERSION_ID//\"/} VERSION_ID=${VERSION_ID%%.*} OS_VER=$OS-$VERSION_ID +DHCPCD=`which dhcpcd` case $OS_VER in "fedora-18" | \ @@ -46,7 +47,6 @@ fi # interruptions return last stage number recorded (1-9) if [ -f /etc/iiab/iiab.env ] then - STAGE=1 source /etc/iiab/iiab.env STAGE=$STAGE else @@ -56,10 +56,11 @@ ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ") cat <