Commit 207e160f authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño Committed by Thomas Gambier

Remove Ansible includes.

Includes were deprecated and have been removed in recent Ansible
versions, in favor of import_tasks and include_tasks.

I replaced them for either of these, as it seemed appropriate.

See merge request !196
parent 38cc830c
Pipeline #38456 failed with stage
in 0 seconds
......@@ -10,7 +10,7 @@
stat: path=/etc/re6stnet/re6stnet.conf
register: re6stnet_conf
- include: sysctl.yml
- import_tasks: sysctl.yml
- name: Update Facts
set_fact:
......@@ -58,7 +58,7 @@
copy: src=/etc/systemd/re6stnet.service dest=/etc/systemd/system/re6stnet.service
when: ansible_distribution == 'CentOS' and ansible_distribution_version >= '7' and re6stnet.stat.exists == True and re6stnode.stat.exists == False
- include: daemon.yml
- import_tasks: daemon.yml
- name: Create centos 6 init.d missing file
copy: src=centos_6_init_d dest=/etc/init.d/re6stnet mode=755
......@@ -70,5 +70,5 @@
- name: Include re6stnet-ip6tables-check at reboot on cron
cron: name="ip6tables at reboot" special_time=reboot job="sleep 20 && /usr/bin/re6stnet-ip6tables-check"
- include: tcp_nodelay.yml
- import_tasks: tcp_nodelay.yml
- include: fedora_init.yml
- import_tasks: fedora_init.yml
- include: debian_init.yml
- import_tasks: debian_init.yml
- name: Force HTTP repository for old debian versions without HTTPS support
set_fact:
......
---
#- include: "{{ ansible_distribution |lower }}.yml"
#- include_tasks: "{{ ansible_distribution |lower }}.yml"
- assert: { that: "ansible_distribution == 'Debian'" }
- include: debian.yml
- import_tasks: debian.yml
#- command: "{{role_path}}/gen-ipcm-conf"
- command: roles/rina/gen-ipcm-conf
......
......@@ -13,11 +13,11 @@
register: pip3_installed
- name: Install slapcache on Debian < 9
include: pip_installations_success.yml
include_tasks: pip_installations_success.yml
when: ansible_distribution == "Debian" and ansible_distribution_major_version|int < 9
- name: Install slapcache on Debian >= 9
include: pip_installations_succeeded.yml
include_tasks: pip_installations_succeeded.yml
when: ansible_distribution == "Debian" and ansible_distribution_major_version|int >= 9
- name: Install slapcache on Ubuntu
......
---
- include: debian9-gcc-4.9.yml
- import_tasks: debian9-gcc-4.9.yml
- name: Install iptables
apt:
......
---
- include: remove-slapos-package.yml
- import_tasks: remove-slapos-package.yml
......@@ -157,7 +157,7 @@
- shell: echo {{ ansible_date_time.epoch }} > /opt/upgrader/last-upgrade
when: (lookup('file', '/opt/upgrader/playbook-tmp/upgrade_after')|int > lookup('file', '/opt/upgrader/last-upgrade')|int )
- include: remove-legacy.yml
- import_tasks: remove-legacy.yml
- name: Setting playbook report message
set_fact: playbook_report_message="Successfully ran playbook" playbook_report_progress="100"
......
......@@ -30,8 +30,8 @@
- name: Allow ping for all users (no need for SUID binary)
sysctl: name="net.ipv4.ping_group_range" value="0 2147483647" sysctl_set=yes state=present reload=yes
- include: kvm.yml
- include: shuttle-modprobe.yml
- import_tasks: kvm.yml
- import_tasks: shuttle-modprobe.yml
- name: Increase ulimit
copy: src="slapos_limit.conf" dest="/etc/security/limits.d/slapos.conf" mode=0644 owner=root group=root
......
......@@ -14,4 +14,4 @@
- name: echo 1 > /sys/kernel/mm/ksm/run
shell: echo 1 > /sys/kernel/mm/ksm/run
- include: user.yml
- import_tasks: user.yml
- include: uploadlog.yml
- import_tasks: uploadlog.yml
- include: rerun.yml
- import_tasks: rerun.yml
- name: Create /etc/opt dir
file: dest=/etc/opt mode=775 state=directory
......@@ -39,10 +39,10 @@
ignore_errors: True
register: upgrade_needed
- include: network.yml
- include: hostname.yml
- include: user.yml
- include: ssh.yml
- import_tasks: network.yml
- import_tasks: hostname.yml
- import_tasks: user.yml
- import_tasks: ssh.yml
- name: Enable hotplugged CPU and Memory automatically
lineinfile: dest=/etc/udev/rules.d/99-hotplug-cpu-mem.rules state=present create=yes line="{{ item }}"
......@@ -60,5 +60,7 @@
shell: echo 1 > /opt/upgrader/last-upgrade
when: last_upgrade.stat.exists == False
- include: upgrader.yml upgrade_after={{ upgrade_needed.content }}
- include_tasks: upgrader.yml
vars:
upgrade_after: "{{ upgrade_needed.content }}"
when: upgrade_needed.status in [200, 304] and (upgrade_needed.content|int > lookup('file', '/opt/upgrader/last-upgrade')|int)
......@@ -7,7 +7,10 @@
apt: name=sudo state=latest update_cache=yes cache_valid_time=86400
when: ansible_os_family == "Debian"
- include: ../../yum/tasks/main.yml name=sudo cache_valid_time=86400
- include_tasks: ../../yum/tasks/main.yml
vars:
name: sudo
cache_valid_time: 86400
when: ansible_os_family == "RedHat"
- name: Ensure /etc/sudoers.d directory is present
......
c45d79c4610e2561c297f9543090fd4563148b3dc3c279418442dc8a3c370a89 -
abec663fd2831372c78a86ef8a646e7940d6777b811524f9c6e5fd5566fb7822 -
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment