From c07c0d2d7619421e71a5d59149f9f03efa799a3d Mon Sep 17 00:00:00 2001 From: Adam Holt Date: Mon, 30 Oct 2017 23:55:24 -0400 Subject: [PATCH] 56 changes to include_tasks --edits double check after rebase --- roles/0-init/tasks/main.yml | 4 +- roles/1-prep/tasks/main.yml | 4 +- roles/2-common/tasks/main.yml | 16 ++++---- roles/ajenti/tasks/main.yml | 2 +- roles/awstats/tasks/main.yml | 2 +- roles/dokuwiki/tasks/main.yml | 2 +- roles/httpd/tasks/main.yml | 2 +- roles/iiab-admin/tasks/main.yml | 4 +- roles/kalite/tasks/main.yml | 10 ++--- roles/kiwix/tasks/main.yml | 2 +- roles/mysql/tasks/main.yml | 4 +- roles/network/tasks/detected_network.yml | 2 +- roles/network/tasks/ifcfg_mods.yml | 8 ++-- roles/network/tasks/main.yml | 50 ++++++++++++++---------- roles/network/tasks/squid.yml | 2 +- roles/network/tasks/static.yml | 2 +- roles/nextcloud/tasks/main.yml | 2 +- roles/owncloud/tasks/main.yml | 2 +- roles/rachel/tasks/main.yml | 2 +- roles/sugar-stats/tasks/main.yml | 2 +- roles/teamviewer/tasks/main.yml | 2 +- roles/wordpress/tasks/main.yml | 2 +- 22 files changed, 68 insertions(+), 60 deletions(-) diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 31e8e2054..e7351e158 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -14,10 +14,10 @@ # we need to inialize the ini file and only write the location and version sections once and only # once to preserve the install date and git hash. -- include: roles/1-prep/tasks/iiab_ini.yml +- include_tasks: roles/1-prep/tasks/iiab_ini.yml when: first_run # Now load the computed vars -- include: roles/1-prep/tasks/computed_vars.yml +- include_tasks: roles/1-prep/tasks/computed_vars.yml - name: ...HAS COMPLETED =========================================== command: echo diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index fea4ea34f..a96e281f6 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -70,11 +70,11 @@ when: ansible_local.local_facts.os == "raspbian" ignore_errors: true -- include: prep.yml +- include_tasks: prep.yml when: first_run # Put conditional actions for hardware platforms here -- include: raspberry_pi_2.yml +- include_tasks: raspberry_pi_2.yml when: first_run and rpi_model != "none" - name: Check if the identifier for Intel's NUC6 builtin WiFi is present diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml index c7af19941..ec15dcee5 100644 --- a/roles/2-common/tasks/main.yml +++ b/roles/2-common/tasks/main.yml @@ -3,22 +3,22 @@ - name: ...IS BEGINNING ========================================== command: echo -#- include: iiab_ini.yml +#- include_tasks: iiab_ini.yml # create the directory structure for IIAB -- include: fl.yml +- include_tasks: fl.yml -- include: xo.yml +- include_tasks: xo.yml when: xo_model != "none" or osbuilder is defined -- include: centos.yml +- include_tasks: centos.yml when: ansible_distribution == "CentOS" -- include: fedora.yml +- include_tasks: fedora.yml when: ansible_distribution == "Fedora" # the following installs common packages for both debian and fedora -- include: packages.yml +- include_tasks: packages.yml - sysctl: name=net.ipv4.ip_forward value=1 state=present - sysctl: name=net.ipv4.conf.default.rp_filter value=1 state=present @@ -43,10 +43,10 @@ mode=0644 backup=no -- include: net_mods.yml +- include_tasks: net_mods.yml when: not is_debuntu and not is_F18 -- include: udev.yml +- include_tasks: udev.yml - name: Recording STAGE 2 HAS COMPLETED ========================== lineinfile: dest=/etc/iiab/iiab.env diff --git a/roles/ajenti/tasks/main.yml b/roles/ajenti/tasks/main.yml index 93f7bacd0..789afbf31 100644 --- a/roles/ajenti/tasks/main.yml +++ b/roles/ajenti/tasks/main.yml @@ -37,7 +37,7 @@ mode=0744 state=file -- include: ajenti-wondershaper.yml +- include_tasks: ajenti-wondershaper.yml when: 'iiab_lan_iface != ""' # handler doesn't fire diff --git a/roles/awstats/tasks/main.yml b/roles/awstats/tasks/main.yml index f1feed18c..8a9cd37e3 100644 --- a/roles/awstats/tasks/main.yml +++ b/roles/awstats/tasks/main.yml @@ -1,4 +1,4 @@ -- include: install.yml +- include_tasks: install.yml when: awstats_install - name: Add AWStats to service list diff --git a/roles/dokuwiki/tasks/main.yml b/roles/dokuwiki/tasks/main.yml index 9841a32b6..5b2d738ce 100644 --- a/roles/dokuwiki/tasks/main.yml +++ b/roles/dokuwiki/tasks/main.yml @@ -1,5 +1,5 @@ - name: Include the install playbook - include: install.yml + include_tasks: install.yml when: dokuwiki_install - name: Add DokuWiki to service list diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 2eb71b8ce..4319e141b 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -142,7 +142,7 @@ state=absent when: is_debuntu -- include: html.yml +- include_tasks: html.yml tags: - base diff --git a/roles/iiab-admin/tasks/main.yml b/roles/iiab-admin/tasks/main.yml index 4541f4027..5f609238b 100644 --- a/roles/iiab-admin/tasks/main.yml +++ b/roles/iiab-admin/tasks/main.yml @@ -1,9 +1,9 @@ -- include: admin-user.yml +- include_tasks: admin-user.yml tags: - base when: not no_admin is defined -- include: access.yml +- include_tasks: access.yml tags: - base diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index b0c02471d..74dd9229b 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -16,23 +16,23 @@ stat: path="{{ kalite_db_name }}" register: kalite_installed -- include: install-f18.yml +- include_tasks: install-f18.yml when: not kalite_installed.stat.exists and is_F18 -- include: install.yml +- include_tasks: install.yml when: kalite_installed is defined and not kalite_installed.stat.exists and not is_F18 - name: Ask systemd to reread the unit files shell: systemctl daemon-reload when: not kalite_installed.stat.exists -- include: setup-f18.yml +- include_tasks: setup-f18.yml when: not kalite_installed.stat.exists and is_F18 -- include: setup.yml +- include_tasks: setup.yml when: not kalite_installed.stat.exists and not is_F18 -- include: enable.yml +- include_tasks: enable.yml - name: Add kalite to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index c7409db31..9a1cfc2b0 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -20,7 +20,7 @@ get_url: url="{{ iiab_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}" when: internet_available -- include: kiwix_install.yml +- include_tasks: kiwix_install.yml when: kiwix_src_file is defined tags: - kiwix diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index ecc42815f..4afc6d0ab 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -45,12 +45,12 @@ tags: - download - - include: centos.yml + - include_tasks: centos.yml when: ansible_distribution == "CentOS" tags: - download - - include: fedora.yml + - include_tasks: fedora.yml when: ansible_distribution == "Fedora" tags: - download diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index 6c422a746..d52cbc194 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -27,7 +27,7 @@ when: discovered_wan_iface != "none" - name: RedHat network detection - include: detected_redhat.yml + include_tasks: detected_redhat.yml when: is_redhat - name: check to see if dhcpcd is installed and active - Can Fail diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index 39c4d0156..cdc22be6f 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -43,17 +43,17 @@ when: (num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none") ## vars/ users should set user_wan_iface to avoid messy redetect -- include: redetect.yml +- include_tasks: redetect.yml when: discovered_wan_iface == "none" and user_wan_iface == "auto" # move gateway if not WAN # might have wifi info if wireless is used as uplink. -- include: edit_ifcfg.yml +- include_tasks: edit_ifcfg.yml when: has_wifi_gw == "none" and has_ifcfg_gw != "none" and has_ifcfg_gw != "/etc/sysconfig/network-scripts/ifcfg-WAN" # create ifcfg-WAN if missing # if we get here we have gateway but no ifcfg file -- include: create_ifcfg.yml +- include_tasks: create_ifcfg.yml when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none" and xo_model == "none" and not iiab_demo_mode - name: Configuring LAN interface as iiab_lan_iface @@ -76,7 +76,7 @@ tags: - network -- include: enable_wan.yml +- include_tasks: enable_wan.yml when: not installing and not iiab_demo_mode - name: ask systemd to reread the unit files, picks up changes done diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index bf6a96334..71ac61418 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,10 +1,10 @@ -- include: detected_network.yml +- include_tasks: detected_network.yml when: not installing tags: - network - network-discover -- include: computed_network.yml +- include_tasks: computed_network.yml when: not installing tags: - network @@ -44,30 +44,29 @@ - domain ##### Start static ip address info for first run ##### -#- include: static.yml +#- include_tasks: static.yml # when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"' ##### End static ip address info -- include: hosts.yml +- include_tasks: hosts.yml tags: - network - domain -##### end hostname setup -##### start install portion -# only needs to be done once -- include: installing.yml +- include_tasks: named.yml tags: - network - named + +- include_tasks: dhcpd.yml + tags: - dhcpd - dnsmasq - squid - domain # when: hostname_change.changed or installing - -- include: avahi.yml +- include_tasks: squid.yml tags: - network @@ -81,7 +80,7 @@ # - network # - network-discover -- include: computed_services.yml +- include_tasks: wondershaper.yml tags: - network - named @@ -89,8 +88,7 @@ - dnsmasq - squid -# templates needed from above install section live here -- include: enable_services.yml +- include_tasks: iptables.yml tags: - network - named @@ -98,19 +96,23 @@ - dnsmasq - squid -- include: hostapd.yml +- include_tasks: avahi.yml tags: - network -- include: ifcfg_mods.yml - when: not is_debuntu and not installing +- include_tasks: ifcfg_mods.yml tags: - network -- include: debian.yml - when: is_debuntu and not installing +- include_tasks: debian.yml tags: - network + when: is_debuntu and not is_rpi and not installing + +- include_tasks: rpi_debian.yml + tags: + - network + when: is_debuntu and is_rpi and not installing - name: Create IIAB network flags template: src=network/{{ item }}.j2 @@ -122,10 +124,16 @@ when: not installing tags: - network -#### end network layout -#### start services -- include: restart.yml +- include_tasks: computed_services.yml + tags: + - network + +- include_tasks: enable_services.yml + tags: + - network + +- include_tasks: restart.yml when: not installing tags: - network diff --git a/roles/network/tasks/squid.yml b/roles/network/tasks/squid.yml index 1abadaf4b..6ef23db3f 100644 --- a/roles/network/tasks/squid.yml +++ b/roles/network/tasks/squid.yml @@ -64,7 +64,7 @@ mode=0750 state=directory -- include: dansguardian.yml +- include_tasks: dansguardian.yml when: dansguardian_install #- name: Stop Squid diff --git a/roles/network/tasks/static.yml b/roles/network/tasks/static.yml index 4168ab9a7..06ac8b391 100644 --- a/roles/network/tasks/static.yml +++ b/roles/network/tasks/static.yml @@ -4,7 +4,7 @@ template: src=network/ifcfg-WAN.j2 dest=/etc/sysconfig/network-scripts/ifcfg-WAN -- include: NM.yml +- include_tasks: NM.yml when: 'ansible_distribution_version <= "20" and wan_ip != "dhcp"' - name: Re-read network config files diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 06e8c9bfc..cd6b5dd9c 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -120,7 +120,7 @@ # Enable nextcloud by copying template to httpd config # following enables and disables -- include: nextcloud_enabled.yml +- include_tasks: nextcloud_enabled.yml - name: Add Nextcloud to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/owncloud/tasks/main.yml b/roles/owncloud/tasks/main.yml index 03e8fb872..12bcbdcc8 100644 --- a/roles/owncloud/tasks/main.yml +++ b/roles/owncloud/tasks/main.yml @@ -102,7 +102,7 @@ # Enable owncloud by copying template to httpd config -- include: owncloud_enabled.yml +- include_tasks: owncloud_enabled.yml when: owncloud_enabled - name: Add owncloud to service list diff --git a/roles/rachel/tasks/main.yml b/roles/rachel/tasks/main.yml index 898a212d5..f37843250 100644 --- a/roles/rachel/tasks/main.yml +++ b/roles/rachel/tasks/main.yml @@ -20,7 +20,7 @@ rachel_content_found: True when: rachel_content.stat.exists == true -- include: rachel_enabled.yml +- include_tasks: rachel_enabled.yml when: rachel_enabled and rachel_content_found - name: Add rachel to service list diff --git a/roles/sugar-stats/tasks/main.yml b/roles/sugar-stats/tasks/main.yml index c42d6ef7f..6f9f708dc 100644 --- a/roles/sugar-stats/tasks/main.yml +++ b/roles/sugar-stats/tasks/main.yml @@ -38,7 +38,7 @@ enabled=no when: not sugar_stats_enabled -- include: statistics-consolidation.yml +- include_tasks: statistics-consolidation.yml - name: Add sugar-stats to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/teamviewer/tasks/main.yml b/roles/teamviewer/tasks/main.yml index 9421a919c..7ea48de93 100644 --- a/roles/teamviewer/tasks/main.yml +++ b/roles/teamviewer/tasks/main.yml @@ -5,7 +5,7 @@ when: ansible_architecture == "armv7l" or not is_redhat - name: Install Teamviewer if intel - include: install.yml + include_tasks: install.yml when: teamviewer_install - name: Add teamviewer to service list diff --git a/roles/wordpress/tasks/main.yml b/roles/wordpress/tasks/main.yml index db4eb2c53..4a77b45f8 100644 --- a/roles/wordpress/tasks/main.yml +++ b/roles/wordpress/tasks/main.yml @@ -1,3 +1,3 @@ - name: Include the install playbook - include: install.yml + include_tasks: install.yml when: wordpress_install \ No newline at end of file