How to fix the ansible playbook error "Unsupported parameters for (systemd) module: enable Supported parameters?

11,227

The right parameter is enabled (not enable) in your service tasks.

  - name: restart apache2 afetr restart
    service:
      name: apache2
      enabled: yes
      state: restarted
Share:
11,227
Armaan
Author by

Armaan

Updated on July 17, 2022

Comments

  • Armaan
    Armaan almost 2 years

    I am trying to install Apache 2, PHP on Ubuntu machine using the ansible-playbook. I am getting the following error Error after executing playbook

    fatal: [18.220.215.181]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (systemd) module: enable Supported parameters include: daemon_reexec, daemon_reload, enabled, force, masked, name, no_block, scope, state, user"}The ansible playbook is as follows--- - hosts: all become: yes tasks: - name: Chenking ping ping: - name: Update packages apt: name: apache2 update_cache: yes state: present - name: restart apache2 server service: name: apache2 enable: yes state: restarted - name: install php module apt: name: "{{ item }}" state: present with_items: - php - libapache2-mod-php5 - php-mcrypt - php-mysql - name: restart apache2 afetr restart service: name: apache2 enable: yes state: restarted

    `

    • Augusto
      Augusto almost 5 years
      What version of Ubuntu and Ansible? and can you post the whole error message, as it's not clear on what task the error happens.
    • Armaan
      Armaan almost 5 years
      Ubuntu version is 18 and ansible version is 2.8, For error message click on hyperlink "Error after executing playbook" in above question i have attached the error message in form of image