Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from "include:" to "import_tasks:" to resolve warnings #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Sets Fully qualified domain name (FQDN)
Requirements
------------

Ansible version 2.0+
Ansible version 2.4+

## Platforms

Expand Down
8 changes: 4 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ boxes = [
:ram => "256"
},
{
:name => "debian-711",
:box => "bento/debian-7.11",
:name => "debian-12",
:box => "debian/bookworm64",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-86",
:box => "bento/debian-8.6",
:name => "debian-11",
:box => "debian/bullseye64",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "256"
Expand Down
8 changes: 4 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
galaxy_info:
role_name: fqdn
namespace: holms
author: Roman Gorodeckij
description: Set FQDN and hostname
license: MIT
min_ansible_version: 2.0
min_ansible_version: 2.4
platforms:
- name: EL
versions:
Expand All @@ -20,6 +22,4 @@ galaxy_info:
categories:
- networking
- system

dependencies: []

dependencies: {}
8 changes: 4 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
- name: fqdn | Configure Debian
include: debian.yml
import_tasks: debian.yml
when: ansible_os_family == 'Debian'

- name: fqdn | Configure Redhat
include: redhat.yml
import_tasks: redhat.yml
when: ansible_os_family == 'RedHat'

- name: fqdn | Configure Linux
include: linux.yml
import_tasks: linux.yml
when: ansible_system in [ 'Linux' ]

- name: fqdn | Configure Windows
include: windows.yml
import_tasks: windows.yml
when: ansible_system in [ 'Win32NT' ]
4 changes: 2 additions & 2 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
connection: local
become: true
pre_tasks:
- include: pre.yml
- import_tasks: pre.yml
roles:
- ../../
post_tasks:
- include: post.yml
- import_tasks: post.yml
vars:
hostname: mx
fqdn: mx.example.com
4 changes: 2 additions & 2 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
remote_user: vagrant
become: true
pre_tasks:
- include: pre.yml
- import_tasks: pre.yml
roles:
- ../../
post_tasks:
- include: post.yml
- import_tasks: post.yml
vars:
hostname: mx
fqdn: mx.example.com