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

ipabackup - ipabackup_name parameter evaluation #1198

Open
FF186 opened this issue Jan 10, 2024 · 2 comments
Open

ipabackup - ipabackup_name parameter evaluation #1198

FF186 opened this issue Jan 10, 2024 · 2 comments

Comments

@FF186
Copy link

FF186 commented Jan 10, 2024

Experience error when I try to run ipabackup role twice.

Playbook:

pre_tasks:
    - ansible.builtin.find:
        path: /var/lib/ipa/backup
        file_type: directory
      register: _result

    - set_fact:
        _name: "{{ (_result.files | sort(attribute='path') | first).path }}"

  roles:
    - role: freeipa.ansible_freeipa.ipabackup
      vars:
        state: present

    - role: freeipa.ansible_freeipa.ipabackup
      when: _result.files | length > 5
      vars:
        ipabackup_name: "{{ _name }}"
        state: absent

Error message:

 FAILED! => {"changed": false, "msg": "ipabackup_name is given and state is not copied, restored or absent"}
@FF186 FF186 closed this as completed Jan 10, 2024
@FF186 FF186 reopened this Jan 10, 2024
@FF186
Copy link
Author

FF186 commented Jan 10, 2024

Works:

  roles:
    - {role: freeipa.ansible_freeipa.ipabackup, ipabackup_name: "{{ _name }}", state: absent}
    - {role: freeipa.ansible_freeipa.ipabackup, state: present}

Does not work:

  roles:
    - {role: freeipa.ansible_freeipa.ipabackup, state: present}
    - {role: freeipa.ansible_freeipa.ipabackup, ipabackup_name: "{{ _name }}", state: absent}

@FF186
Copy link
Author

FF186 commented Jan 25, 2024

I want to e.g backup only data, but a full backup is being made:

Creates full backup:

    - import_role:
        name: freeipa.ansible_freeipa.ipabackup
      vars:
          ipabackup_data: present
          state: present

Data backup fails:
Even if the documentation says state: present is default.

    - import_role:
        name: freeipa.ansible_freeipa.ipabackup
      vars:
          ipabackup_data: present



FAILED! => {"changed": false, "msg": "ipabackup_name is given and state is not copied, restored or absent"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants