# Ansible Reboot Error...

**URL:** <https://forum.ansible.com/t/ansible-reboot-error/32575>\
**Category:** Ansible Project\
**Created:** [March 31, 2020, 7:11pm UTC](https://forum.ansible.com/t/ansible-reboot-error/32575 "2020-03-31T19:11:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmarty009](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kmarty009](https://forum.ansible.com/u/kmarty009)\
**Post date:** [March 31, 2020, 7:11pm UTC](https://forum.ansible.com/t/ansible-reboot-error/32575/1 "2020-03-31T19:11:14Z")

</div>

I get this error when executing my playbook. I need to reboot the machine but cannot get around this insane error that is preventing me from doing so.. the plybook works until I add the last line for reboot. Can anyone tell me what is wrong here please??? Thanks in advance.

\*\*\*\* ERROR SECTION\*\*\*\*\*

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in ‘/home/kmarty/ansible/roles/basic/tasks/main.yml’: line 53, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Reboot Machine  
^ here

The error appears to have been in ‘/home/kmarty/ansible/roles/basic/tasks/main.yml’: line 53, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Reboot Machine  
^ here

exception type: \<class ‘ansible.errors.AnsibleParserError’\>  
exception: no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in ‘/home/kmarty/ansible/roles/basic/tasks/main.yml’: line 53, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Reboot Machine  
^ here

\*\*\*\* PLAYBOOK\*\*\*\*\*\*

#ansible Configuration Playbook for On-Premise Installs  
#Created by: Kirk Marty [kmarty009@gmail.com](mailto:kmarty009@gmail.com)  
#version 1.0  
#Date: 3/31/2020

- name: “Required Software Packages that will be utilized - yum installs”  
yum: pkg={{ item }} state=installed  
with\_items:
- nano
- vim
- tar
- xz
- unzip
- wget
- curl
- bind-utils
- net-tools
- ntp
- epel-release

# Update the system to latest patches and applications via yum

- name: “update the Centos Server 7 with latest patches and applications”  
yum:  
name: “\*”  
state: latest

- name: be sure firewalld is installed  
yum: name=firewalld state=installed  
tags:

- install

- firewalld

- name: be sure firewalld is disabled  
systemd: name=firewalld enabled=no  
tags:

- install

- atomic

- firewalld

- name: be sure firewalld is stopped  
systemd: name=firewalld state=stopped  
ignore\_errors: yes  
tags:

- install

- atomic

- firewalld

- name: Disable SELinux  
selinux:  
state: disabled

- name: Reboot Server to apply some changes and updates  
reboot:

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 31, 2020, 8:22pm UTC](https://forum.ansible.com/t/ansible-reboot-error/32575/2 "2020-03-31T20:22:05Z")

</div>

This usually means that the ansible version you use does not know that module.  
According to [https://docs.ansible.com/ansible/latest/modules/reboot\_module.html](https://docs.ansible.com/ansible/latest/modules/reboot_module.html)  
the reboot module was introduced in 2.7.  
This indicates you're using something older.

What is the output of 'ansible --version'?

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [March 31, 2020, 8:24pm UTC](https://forum.ansible.com/t/ansible-reboot-error/32575/3 "2020-03-31T20:24:32Z")

</div>

It’s telling you it cannot find the reboot module/plugin. Make sure you are on Ansible 2.7 or higher as that is when the module was added [https://docs.ansible.com/ansible/latest/modules/reboot\_module.html](https://docs.ansible.com/ansible/latest/modules/reboot_module.html),

---

<div class="post-metadata">

**Author:** ![kmarty009](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kmarty009](https://forum.ansible.com/u/kmarty009)\
**Post date:** [April 1, 2020, 12:02am UTC](https://forum.ansible.com/t/ansible-reboot-error/32575/4 "2020-04-01T00:02:00Z")

</div>

Interesting! Thanks for the responses! I really appreciate it.

I’m new to ansible and trying to get into a love affair with it. I’m running CentOS 7.7.1908 and Ansible 2.4.2.0 was installed.

I did a yum install epel-release and I got installed new version at 2.9.6

Of course, that worked and rebooted my machine! However, I did run into new issues with DEPRECATION WARNING. I think it’s not liking the state=installed. If I’m reading the manual (RTFM) it wants a newer flag of state=present.

I also don’t think it’s loving the {{ item }} flag and wants something different. {{ packages }}?

[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via squash\_actions is deprecated. Instead of using a loop to supply  
multiple items and specifying `pkg: "{{ item }}"`, please use `pkg: ['nano', 'vim', 'tar', 'xz', 'unzip', 'wget', 'curl', 'bind-utils', 'net- tools', 'ntp', 'epel-release']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by  
setting deprecation\_warnings=False in ansible.cfg.  
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via squash\_actions is deprecated. Instead of using a loop to supply  
multiple items and specifying `pkg: "{{ item }}"`, please use `pkg: ['nano', 'vim', 'tar', 'xz', 'unzip', 'wget', 'curl', 'bind-utils', 'net- tools', 'ntp', 'epel-release']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by  
setting deprecation\_warnings=False in ansible.cfg.

---

<div class="post-metadata">

**Author:** ![kmarty009](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kmarty009](https://forum.ansible.com/u/kmarty009)\
**Post date:** [April 1, 2020, 12:23am UTC](https://forum.ansible.com/t/ansible-reboot-error/32575/5 "2020-04-01T00:23:16Z")

</div>

I got it all working. I had to update the hosts, file and use new syntax that was outlined in the documentation. Thanks everyone, I’m all good!
