From fee3cd049d974a0b661f403e9944927cde647449 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 16:55:12 -0500 Subject: [PATCH 1/2] indentation/syntax per new Ansible documentation --- roles/awstats/tasks/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/awstats/tasks/main.yml b/roles/awstats/tasks/main.yml index 20e93b5b2..e368ae8cf 100644 --- a/roles/awstats/tasks/main.yml +++ b/roles/awstats/tasks/main.yml @@ -2,10 +2,11 @@ when: awstats_install - name: Add 'awstats' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=awstats - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: awstats + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: name value: AWStats From 6b1f58b066589933acd76a36d507e387f8fe6fdd Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 17:01:40 -0500 Subject: [PATCH 2/2] indentation/syntax per new Ansible documentation --- roles/awstats/tasks/install.yml | 90 ++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml index 06273e9a5..df3d4b212 100644 --- a/roles/awstats/tasks/install.yml +++ b/roles/awstats/tasks/install.yml @@ -1,6 +1,7 @@ - name: Install AWStats package - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - awstats - pwauth @@ -9,8 +10,9 @@ - download - name: Install AWStats package (debuntu) - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - libapache2-mod-authnz-external - apache2-utils @@ -18,74 +20,82 @@ tags: - download -- name: enable cgi execution (debuntu) +- name: Enable cgi execution (debuntu) command: a2enmod cgi when: is_debuntu - name: Create directory for AWStats to use as intermediate summary storage - file: path={{ item }} - mode=0750 - owner={{ apache_user }} - group={{ apache_user }} - state=directory - force=true + file: + path: "{{ item }}" + mode: 0750 + owner: "{{ apache_user }}" + group: "{{ apache_user }}" + state: directory + force: true with_items: - "{{ awstats_data_dir }}" - "{{ apache_log_dir }}" - name: Install the Apache config for AWStats (debuntu) - template: src=apache.conf - dest=/etc/{{ apache_config_dir }}/awstats.conf - owner=root - group=root - mode=0644 + template: + src: apache.conf + dest: "/etc/{{ apache_config_dir }}/awstats.conf" + owner: root + group: root + mode: 0644 when: awstats_enabled and is_debuntu - name: Install the Apache config for AWStats (OS's other than debuntu) - template: src=apache-awstats.conf - dest=/etc/{{ apache_config_dir }}/awstats.conf - owner=root - group=root - mode=0644 + template: + src: apache-awstats.conf + dest: "/etc/{{ apache_config_dir }}/awstats.conf" + owner: root + group: root + mode: 0644 when: awstats_enabled and not is_debuntu -- name: make sure logrotate does not make logs unreadable (debuntu) - template: src=logrotate.d.apache2 - dest=/etc/logrotate.d/apache2 +- name: Make sure logrotate does not make logs unreadable (debuntu) + template: + src: logrotate.d.apache2 + dest: /etc/logrotate.d/apache2 when: is_debuntu -- name: See if awstats package installed a config file - stat: path=/etc/awstats/awstats.conf +- name: See if AWStats package installed a config file + stat: + path: /etc/awstats/awstats.conf register: awstats - - name: If there was a config file installed by package, move it aside command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist when: awstats.stat.islnk is defined and not awstats.stat.islnk - name: Enable AWStats (debuntu) - file: src=/etc/apache2/sites-available/awstats.conf - path=/etc/apache2/sites-enabled/awstats.conf - state=link + file: + src: /etc/apache2/sites-available/awstats.conf + path: /etc/apache2/sites-enabled/awstats.conf + state: link when: awstats_enabled and is_debuntu - name: Disable AWStats (debuntu) - file: path=/etc/apache2/sites-enabled/awstats.conf - state=absent + file: + path: /etc/apache2/sites-enabled/awstats.conf + state: absent when: not awstats_enabled and is_debuntu - name: Install the AWStats config - template: src=awstats.schoolserver.conf.j2 - dest=/etc/awstats/awstats.schoolserver.conf - owner=root - group=root - mode=0644 + template: + src: awstats.schoolserver.conf.j2 + dest: /etc/awstats/awstats.schoolserver.conf + owner: root + group: root + mode: 0644 when: awstats_enabled - name: Create a symbolic link to use when access is by IP address - file: src=/etc/awstats/awstats.schoolserver.conf - dest=/etc/awstats/awstats.conf - state=link + file: + src: /etc/awstats/awstats.schoolserver.conf + dest: /etc/awstats/awstats.conf + state: link when: awstats_enabled - name: On first enabling of AWStats, summarize httpd logs up to now (OS's other than debuntu)