0

We hava a mixture of CentOS, RedHat, Debian and Ubuntu servers all over the place. I am trying to install generic packages that have the same name for all Distros. The package module seems to work only on CentOS / Redhat boxes, but on Debian boxes it keeps on installing the package. After the script completes the packages are not installed. Rerun the script and same thing. I am running Ansible on the latest Mac OS and the version is 2.9.11

What am I missing to get this to work on Debian systems?

I know that as a workaround I can use when: ansible_distribution and determine what version I am running, but that means I have to make the script longer and type the packages twice.

## Installs Generic OS independent packages ##
- name: "Installs base packages"
  package:
    name:  "{{ item }}"
    state: present
  with_items:
    - tcpdump 
    - wget 
    - screen 
2
  • This works fine on Debian systems. What is the real problem you are having? Check your apt logs. – Michael Hampton Oct 25 '20 at 0:23
  • That solved my issue. The package does get installed, but later on my playbook I install a different package that causes a conflict and removes the original package. Thanks, – user2236794 Oct 25 '20 at 1:44
0

the question is in fact irrelevant since the code works as expected - author commented:

That solved my issue. The package does get installed, but later on my playbook I install a different package that causes a conflict and removes the original package. Thanks, – user2236794 Oct 25 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.