Icinga / ansible-playbooks

Ansible Playbook for Icinga 2
GNU General Public License v2.0
225 stars 122 forks source link

Deprecation warning with "include" #68

Closed maccadia closed 6 years ago

maccadia commented 6 years ago

Hi,

I get a deprecation warning when I use icinga2 roles.

[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions. This feature will be removed in a future release. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: include is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be removed in a future release. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
$ rgrep "include:" *
icinga2-ansible-add-hosts/tasks/main.yml:- include: icinga2_add_hosts.yml
icinga2-ansible-classic-ui/tasks/main.yml:- include: icinga2_classic_ui_Debian_install.yml
icinga2-ansible-classic-ui/tasks/main.yml:- include: icinga2_classic_ui_RedHat_install.yml
icinga2-ansible-classic-ui/tasks/main.yml:- include: icinga2_classic_ui_Gentoo_install.yml
icinga2-ansible-no-ui/tasks/main.yml:- include: icinga2_Debian_install.yml
icinga2-ansible-no-ui/tasks/main.yml:- include: icinga2_Ubuntu_install.yml
icinga2-ansible-no-ui/tasks/main.yml:- include: icinga2_RedHat_install.yml
icinga2-ansible-no-ui/tasks/main.yml:- include: icinga2_Gentoo_install.yml
icinga2-ansible-no-ui/tasks/main.yml:- include: icinga2_configure.yml
icinga2-ansible-web2-ui/tasks/main.yml:- include: icinga2_web2_ui_RedHat_install.yml
icinga2-ansible-web2-ui/tasks/main.yml:- include: icinga2_web2_ui_Debian_install.yml
icinga2-ansible-web-ui/tasks/main.yml:- include: icinga2_web_ui_RedHat_install.yml
icinga2-ansible-web-ui/tasks/icinga2_web_ui_RedHat_install.yml:- include: icinga2_web_ui_mysql_RedHat_install.yml
icinga2-nrpe-agent/tasks/main.yml:- include: icinga2_nrpe_agent_RedHat.yml
icinga2-nrpe-agent/tasks/main.yml:- include: icinga2_nrpe_agent_Debian.yml
icinga2-nrpe-agent/tasks/main.yml:- include: icinga2_nrpe_agent_Gentoo.yml

Possible Solution

Replacing include: with include_task:

My Environment

ansible 2.4.3.0
python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Ubuntu 16.04.4 LTS

Thanks a lot for your work.

aflatto commented 6 years ago

Thank you for your input. The original playbooks were written a while back, we are working on keeping them up-to-date,

maccadia commented 6 years ago

I understand. I will try to identify old syntax and let you know. If I can, I will try to send pull requests.

Regards

aflatto commented 6 years ago

the depredations warnings are addressed in PR #75