summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2018-04-04 16:05:58 +0200
committerGuilhem Moulin <guilhem@fripost.org>2018-04-04 16:06:10 +0200
commit8d6dd2e082547d6f814a904181700d7fb54d7127 (patch)
treec41599c7fd3db7441be21acdb5873cbf82aed8bf
parente1fc6a114e23eafc709163d8e6e625c0db211fe5 (diff)
Upgrade syntax to Ansible 2.5.
-rw-r--r--ansible.cfg1
-rw-r--r--lib/action_plugins/openldap.py1
-rw-r--r--roles/common/tasks/main.yml2
-rw-r--r--roles/common/templates/etc/apt/preferences.j22
-rw-r--r--roles/common/templates/etc/apt/sources.list.j24
5 files changed, 4 insertions, 6 deletions
diff --git a/ansible.cfg b/ansible.cfg
index 2de77ef..3b99662 100644
--- a/ansible.cfg
+++ b/ansible.cfg
@@ -9,7 +9,6 @@ forks = 5
poll_interval = 15
transport = ssh
remote_port = 22
-module_lang = C
timeout = 10
# format of string {{ ansible_managed }} available within Jinja2
diff --git a/lib/action_plugins/openldap.py b/lib/action_plugins/openldap.py
index 86ca41f..ae4992a 100644
--- a/lib/action_plugins/openldap.py
+++ b/lib/action_plugins/openldap.py
@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ansible.plugins.action import ActionBase
-from ansible.utils.unicode import to_bytes
from ansible.module_utils._text import to_text
class ActionModule(ActionBase):
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index aca16b6..b3ed8a0 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -6,7 +6,7 @@
tags: apt
- name: Install intel-microcode
apt: pkg=intel-microcode
- when: "ansible_processor[0] | search('^(Genuine)?Intel.*') and not ansible_virtualization_role == 'guest'"
+ when: "ansible_processor[1] is search('^(Genuine)?Intel.*') and not ansible_virtualization_role == 'guest'"
tags: intel
- import_tasks: firewall.yml
tags:
diff --git a/roles/common/templates/etc/apt/preferences.j2 b/roles/common/templates/etc/apt/preferences.j2
index ecbb4ec..4e18a6e 100644
--- a/roles/common/templates/etc/apt/preferences.j2
+++ b/roles/common/templates/etc/apt/preferences.j2
@@ -20,7 +20,7 @@ Pin: version *
Pin-Priority: 200
{% endif %}
-{% if ansible_processor[0] | search('^(Genuine)?Intel.*') and not ansible_virtualization_role == 'guest' -%}
+{% if ansible_processor[1] is search('^(Genuine)?Intel.*') and not ansible_virtualization_role == 'guest' -%}
# Automatically upgrade the microcode (when manually installed)
Package: intel-microcode iucode-tool
Pin: version *
diff --git a/roles/common/templates/etc/apt/sources.list.j2 b/roles/common/templates/etc/apt/sources.list.j2
index 1f51621..40e4925 100644
--- a/roles/common/templates/etc/apt/sources.list.j2
+++ b/roles/common/templates/etc/apt/sources.list.j2
@@ -2,9 +2,9 @@
# Do NOT edit this file directly!
# vim: set filetype=debsources :
-deb http://ftp.{%if geoip is defined %}{{ geoip }}.{% endif %}debian.org/debian/ {{ ansible_lsb.codename }} main{% if inventory_hostname_short in non_free_packages.keys() or (ansible_processor[0] | search("^(Genuine)?Intel.*") and ansible_virtualization_role == 'guest') %} contrib non-free{% endif %}
+deb http://ftp.{%if geoip is defined %}{{ geoip }}.{% endif %}debian.org/debian/ {{ ansible_lsb.codename }} main{% if inventory_hostname_short in non_free_packages.keys() or (ansible_processor[0] is search("^(Genuine)?Intel.*") and ansible_virtualization_role == 'guest') %} contrib non-free{% endif %}
-deb http://security.debian.org/ {{ ansible_lsb.codename }}/updates main{% if inventory_hostname_short in non_free_packages.keys() or (ansible_processor[0] | search("^(Genuine)?Intel.*") and not ansible_virtualization_role == 'guest') %} contrib non-free{% endif %}
+deb http://security.debian.org/ {{ ansible_lsb.codename }}/updates main{% if inventory_hostname_short in non_free_packages.keys() or (ansible_processor[0] is search("^(Genuine)?Intel.*") and not ansible_virtualization_role == 'guest') %} contrib non-free{% endif %}
deb http://ftp.{%if geoip is defined %}{{ geoip }}.{% endif %}debian.org/debian/ {{ ansible_lsb.codename }}-updates main