Skip to main content
added 19 characters in body
Source Link
Pierre.Vriens
  • 7.2k
  • 14
  • 37
  • 84

Ah. Think I've managed to solve this one myself.

First off, it looks as though I was adding the ignore_errors: true clause at the wrong level ... originally I'd added as:

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
        ignore_errors: true

which was causing the errors. Instead, addingindenting ignore_errors as

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
      ignore_errors: true

actually works. Alternatively, I could wrap the task(s) in a block and handle the exit conditions with a rescue: and always: block.

However, for this particular play, and given that the error is sort of known up-front, I think ignoring it is acceptable here.

Ah. Think I've managed to solve this one myself.

First off, it looks as though I was adding the ignore_errors: true clause at the wrong level ... originally I'd added as:

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
        ignore_errors: true

which was causing the errors. Instead, adding as

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
      ignore_errors: true

actually works. Alternatively, I could wrap the task(s) in a block and handle the exit conditions with a rescue: and always: block.

However, for this particular play, and given that the error is sort of known up-front, I think ignoring it is acceptable here.

Ah. Think I've managed to solve this one myself.

First off, it looks as though I was adding the ignore_errors: true clause at the wrong level ... originally I'd added as:

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
        ignore_errors: true

which was causing the errors. Instead, indenting ignore_errors as

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
      ignore_errors: true

actually works. Alternatively, I could wrap the task(s) in a block and handle the exit conditions with a rescue: and always: block.

However, for this particular play, and given that the error is sort of known up-front, I think ignoring it is acceptable here.

Source Link

Ah. Think I've managed to solve this one myself.

First off, it looks as though I was adding the ignore_errors: true clause at the wrong level ... originally I'd added as:

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
        ignore_errors: true

which was causing the errors. Instead, adding as

    - name: Install Python versions
      ansible.builtin.apt:
        name:
          - python3.6
          - python3.6-venv
          - python3.6-dev
          - python3.9
          - python3.9-dev
          - python3.9-venv
        state: latest
        update_cache: true
      ignore_errors: true

actually works. Alternatively, I could wrap the task(s) in a block and handle the exit conditions with a rescue: and always: block.

However, for this particular play, and given that the error is sort of known up-front, I think ignoring it is acceptable here.