Using Amazon Linux 2. Somehow this is the only I can get the playbook run successfully. Without sudo, the playbook always failed with error:
fatal: [10.116.145.22]: FAILED! => {"changed": false, "msg": "Unable to restart service telegraf: Failed to restart telegraf.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files\nSee system logs and 'systemctl status telegraf.service' for details.\n"}
Using Amazon Linux 2. Somehow this is the only I can get the playbook run successfully. Without sudo, the playbook always failed with error:
fatal: [10.116.145.22]: FAILED! => {"changed": false, "msg": "Unable to restart service telegraf: Failed to restart telegraf.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files\nSee system logs and 'systemctl status telegraf.service' for details.\n"}