Adriano Di Giovanni
Adriano Di Giovanni

Reputation: 1515

what does state=installed mean in ansible apt?

What does state=installed mean in ansible apt?

- name: Install Node.js
  apt:
    pkg:
      - nodejs
    state: installed
    update_cache: yes

It is not mentioned in the docs nor elsewhere.

Upvotes: 6

Views: 4511

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68289

If we look into the code:

# Deal with deprecated aliases
if p['state'] == 'installed':
    p['state'] = 'present'
if p['state'] == 'removed':
    p['state'] = 'absent'

installed is a deprecated form of present,
removed is a deprecated form of absent.

Upvotes: 10

Related Questions