From 074c605ade945b95d1950d80c3de260a6f18d623 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 01:53:02 -0400 Subject: [PATCH 01/10] Rename iiab-info.conf.j2 to iiab-info.conf.j2.deprecated --- .../templates/{iiab-info.conf.j2 => iiab-info.conf.j2.deprecated} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename roles/httpd/templates/{iiab-info.conf.j2 => iiab-info.conf.j2.deprecated} (100%) diff --git a/roles/httpd/templates/iiab-info.conf.j2 b/roles/httpd/templates/iiab-info.conf.j2.deprecated similarity index 100% rename from roles/httpd/templates/iiab-info.conf.j2 rename to roles/httpd/templates/iiab-info.conf.j2.deprecated From dde81f5051538eeee599cf74d615cd0a7474ed5f Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:18:54 -0400 Subject: [PATCH 02/10] Update main.yml --- roles/httpd/tasks/main.yml | 53 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 0b887683c..45452dced 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -6,7 +6,7 @@ - apache2 - php{{ php_version }} - php{{ php_version }}-curl -# - php{{ php_version }}-sqlite + #- php{{ php_version }}-sqlite tags: - download when: is_debian @@ -65,10 +65,10 @@ dest: "{{ item.dest }}" owner: root group: root - mode: "{{ item.mode }}" + mode: 0644 with_items: - - { src: '010-iiab.conf.j2', dest: '/etc/{{ apache_config_dir }}/010-iiab.conf', mode: '0644' } - - { src: 'proxy_ajp.conf.j2', dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf', mode: '0644' } + - { src: '010-iiab.conf.j2', dest: '/etc/{{ apache_config_dir }}/010-iiab.conf' } + - { src: 'proxy_ajp.conf.j2', dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf' } #- { src: 'php.ini.j2', dest: '/etc/php.ini', mode: '0644' } # @jvonau suggests removing this in https://github.com/iiab/iiab/issues/1147 # For schools that use WordPress and/or Moodle intensively. See iiab/iiab #1147 @@ -87,7 +87,7 @@ - { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' } # remove symlinks for mpm-event, replace with mpm-prefork -- name: Remove mpm event links (debuntu) +- name: Remove mpm event symlinks (debuntu) file: path: "/etc/apache2/mods-enabled/{{ item }}" state: absent @@ -98,8 +98,8 @@ - name: Create symlinks for mpm-prefork (debuntu) file: - path: "/etc/apache2/mods-enabled/{{ item }}" src: "/etc/apache2/mods-available/{{ item }}" + path: "/etc/apache2/mods-enabled/{{ item }}" state: link with_items: - mpm_prefork.conf @@ -115,13 +115,11 @@ - rewrite when: is_debuntu -- name: Create symlinks for enabling our site (debuntu) +- name: Create 010-iiab.conf symlink enabling our site (debuntu) file: - path: "/etc/apache2/sites-enabled/{{ item }}" - src: "/etc/apache2/sites-available/{{ item }}" + src: "/etc/{{ apache_config_dir }}/010-iiab.conf" + path: /etc/apache2/sites-enabled/010-iiab.conf state: link - with_items: - - 010-iiab.conf when: is_debuntu - name: Remove apache2 default config files (debuntu) @@ -166,7 +164,7 @@ name: "{{ apache_service }}" enabled: yes -- name: Create iiab-info directory +- name: Create /library/www/html/info directory for http://box/info offline docs file: path: "{{ doc_root }}/info" mode: 0755 @@ -174,16 +172,20 @@ group: "{{ apache_user }}" state: directory -- name: Remove iiab-info.conf - file: - dest: "/etc/{{ apache_config_dir }}/iiab-info.conf" - state: absent - -- name: Remove iiab-info.conf symlink (debuntu) - file: - dest: /etc/apache2/sites-enabled/iiab-info.conf - state: absent - when: is_debuntu +# roles/httpd/templates/iiab-info.conf.j2.deprecated is no longer needed, as +# Apache serves http://box/info directly from above /library/www/html/info +# directly (as generated by /usr/bin/iiab-refresh-wiki-docs) +# +#- name: Remove iiab-info.conf +# file: +# path: "/etc/{{ apache_config_dir }}/iiab-info.conf" +# state: absent +# +#- name: Remove iiab-info.conf symlink (debuntu) +# file: +# path: /etc/apache2/sites-enabled/iiab-info.conf +# state: absent +# when: is_debuntu # SEE https://github.com/iiab/iiab/issues/1143 as the old roles/osm playbook is rarely used as of late 2018 (if anybody still uses roles/osm, they can overwrite osm.conf using the original osm playbook, or in other ways) - name: Copy osm.conf for http://box/maps (all OS's) @@ -195,10 +197,11 @@ mode: 0644 backup: yes -- name: Create link from sites-enabled to sites-available (debuntu) +- name: Create osm.conf symlink from sites-enabled to sites-available (debuntu) file: src: "/etc/{{ apache_config_dir }}/osm.conf" - dest: /etc/apache2/sites-enabled/osm.conf + path: /etc/apache2/sites-enabled/osm.conf + #path: "/etc/{{ apache_service }}/sites-enabled/osm.conf" state: link when: is_debuntu @@ -226,6 +229,6 @@ - name: Remove apache_user permission to poweroff file: - dest: /etc/sudoers.d/020_apache_poweroff + path: /etc/sudoers.d/020_apache_poweroff state: absent when: not apache_allow_sudo From eb3577492d8b46085eb729061264e6c2f48a1995 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:25:54 -0400 Subject: [PATCH 03/10] Update html.yml --- roles/httpd/tasks/html.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/html.yml b/roles/httpd/tasks/html.yml index 459441df1..827d5729e 100644 --- a/roles/httpd/tasks/html.yml +++ b/roles/httpd/tasks/html.yml @@ -59,7 +59,7 @@ with_fileglob: - html/services/* -- name: Create symlink from assets to {{ iiab_ini_file }} +- name: Create symlink from /library/www/html/common/assets/iiab.ini to {{ iiab_ini_file }} file: src: "{{ iiab_ini_file }}" dest: "{{ doc_root }}/common/assets/iiab.ini" From 9d9d130c518446131325ce92c80a2f09cb1b2fc1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:29:10 -0400 Subject: [PATCH 04/10] Update main.yml --- roles/httpd/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 45452dced..67e6984a1 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -144,7 +144,7 @@ name: admin state: present -- name: Add {{ apache_user }} (from variable apache_user) to admin group +- name: Add user {{ apache_user }} (from variable apache_user) to admin group user: name: "{{ apache_user }}" groups: admin From 67c7d38459e063af9b54f0316d53ae7db44a2c53 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:36:34 -0400 Subject: [PATCH 05/10] Update main.yml --- roles/httpd/tasks/main.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 67e6984a1..0cc6889f1 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -1,15 +1,10 @@ - name: Install Apache's required packages (debian) package: - name: "{{ item }}" + name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] state: present - with_items: - - apache2 - - php{{ php_version }} - - php{{ php_version }}-curl - #- php{{ php_version }}-sqlite + when: is_debian tags: - download - when: is_debian - name: Debian changed SQLite name (debian-8) package: @@ -23,14 +18,11 @@ - name: Install Apache's required packages (ubuntu) package: - name: "{{ item }}" + name: [u'apache2', u'php'] state: present - with_items: - - apache2 - - php + when: is_ubuntu tags: - download - when: is_ubuntu - name: SQLite3 no longer included in another package (ubuntu-18) package: @@ -39,17 +31,11 @@ - name: Install Apache's required packages (redhat) package: - name: "{{ item }}" + name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] state: present - with_items: - - httpd - - php - - php-curl - - mod_authnz_external -# - php-sqlite + when: is_redhat tags: - download - when: is_redhat # MOVED DOWN ~58 LINES #- name: Remove the default apache2 config file (debuntu) From 4200c9660ea949ddc9e57390da2eca560994e999 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:44:52 -0400 Subject: [PATCH 06/10] Update main.yml --- roles/httpd/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 0cc6889f1..d02f0df82 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -1,6 +1,10 @@ - name: Install Apache's required packages (debian) package: - name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] + #name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] + name: + - apache2 + - "php{{ php_version }}" + - "php{{ php_version }}-curl" state: present when: is_debian tags: From a036b6f92a6c787419f88c8c4498f8314f942dd1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:52:13 -0400 Subject: [PATCH 07/10] Update main.yml --- roles/httpd/tasks/main.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index d02f0df82..f0878df2a 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -22,7 +22,11 @@ - name: Install Apache's required packages (ubuntu) package: - name: [u'apache2', u'php'] + #name: [u'apache2', u'php'] + name: ['apache2', 'php'] + #name: + # - apache2 + # - php state: present when: is_ubuntu tags: @@ -35,7 +39,12 @@ - name: Install Apache's required packages (redhat) package: - name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] + #name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] + name: + - httpd + - php + - php-curl + - mod_authnz_external state: present when: is_redhat tags: From 4799d44d5d7915d6ac34c90d89b3645774ae737f Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 02:58:38 -0400 Subject: [PATCH 08/10] Update main.yml --- roles/httpd/tasks/main.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index f0878df2a..75659cdbd 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -1,6 +1,7 @@ - name: Install Apache's required packages (debian) package: - #name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] + #name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] # FAILS ('u' for Unicode strings) + #name: ['apache2', 'php{{ php_version }}', 'php{{ php_version }}-curl'] # WORKS? name: - apache2 - "php{{ php_version }}" @@ -22,11 +23,11 @@ - name: Install Apache's required packages (ubuntu) package: - #name: [u'apache2', u'php'] - name: ['apache2', 'php'] - #name: - # - apache2 - # - php + #name: [u'apache2', u'php'] # FAILS ('u' for Unicode strings) + #name: ['apache2', 'php'] # WORKS + name: + - apache2 + - php state: present when: is_ubuntu tags: @@ -39,7 +40,8 @@ - name: Install Apache's required packages (redhat) package: - #name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] + #name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] # FAILS ('u' for Unicode strings) + #name: ['httpd', 'php', 'php-curl', 'mod_authnz_external'] # WORKS name: - httpd - php From bcd642dcf12a3092af2ad5048c8f6b15fcf3a5ff Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 03:11:07 -0400 Subject: [PATCH 09/10] Update main.yml --- roles/httpd/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 75659cdbd..62c5dd405 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -221,14 +221,14 @@ dest: /usr/bin/iiab-refresh-wiki-docs mode: 0755 -- name: Give apache_user permission to poweroff +- name: Give {{ apache_user }} (variable apache_user) permission to poweroff template: src: 020_apache_poweroff.j2 dest: /etc/sudoers.d/020_apache_poweroff mode: 0755 when: apache_allow_sudo -- name: Remove apache_user permission to poweroff +- name: Remove {{ apache_user }} (variable apache_user) permission to poweroff file: path: /etc/sudoers.d/020_apache_poweroff state: absent From 782eaf5809c003a19e5335b06911f20b374a0ace Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 03:24:01 -0400 Subject: [PATCH 10/10] Update main.yml --- roles/httpd/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 62c5dd405..caf9a8255 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -221,14 +221,14 @@ dest: /usr/bin/iiab-refresh-wiki-docs mode: 0755 -- name: Give {{ apache_user }} (variable apache_user) permission to poweroff +- name: Give {{ apache_user }} (per variable apache_user) permission to poweroff template: src: 020_apache_poweroff.j2 dest: /etc/sudoers.d/020_apache_poweroff mode: 0755 when: apache_allow_sudo -- name: Remove {{ apache_user }} (variable apache_user) permission to poweroff +- name: Remove {{ apache_user }} (per variable apache_user) permission to poweroff file: path: /etc/sudoers.d/020_apache_poweroff state: absent