Foreman Ansible create tasks playbook

Hello,

i want to make an Ansible playbook with tasks like this:

---
- name: changehistory
  tasks:
    - name: replace text with new text
      replace:
        path: /root/.bashrc
        regexp: 'HISTSIZE='
        replace: HISTSIZE=10000

When i execute the playbook on an host i get following error:
The error appears to be in ‘/usr/share/ansible/collections/ansible_collections/theforeman/foreman/roles/profiles_history/tasks/main.yml’: line 2, column 3, but may

be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • name: changehistory
    ^ here

Foreman Version: 2.5.3
Foreman_Ansible: 6.3.4

Does anyone have an idea.
Thanks.

Are you trying to save that as a job template that you then execute from Foreman? Sorry, it’s.not entirely clear from your question.

1 Like

Hi,
thanks for your answer.
I have import the playbooks as ansible role.

Oh sorry i see the mistake.
I must run the ansible playbook as Job Template.
Thanks for your help.

1 Like

good, hope it works well noe :slight_smile: