aboutsummaryrefslogblamecommitdiffstats
path: root/roles/fedora/tasks/dnf.yml
blob: cc28e97160368e8597c4663f4166215f89e4c31e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11


                          
                             
                        





                                                           




                       

                                                                                                        
       








                           



                        

                                                                                                         
       
            

                        
---
- name: Configure dnf.conf
  ini_file:
    path: '/etc/dnf/dnf.conf'
    no_extra_spaces: yes
    create: no
    section: "{{ item.key.split('.',1)[0] }}"
    option:  "{{ item.key.split('.',1)[1] }}"
    value:   "{{ item.value|ternary(item.value,omit) }}"
    state:   "{{ item.value|ternary('present','absent') }}"
  with_dict: '{{ dnf_conf }}'

- name: Remove packages
  dnf:
    name: '{{ item }}'
    state: absent
  with_items: "{{ dnf_packages|dictsort(true)|selectattr(1,'equalto','absent')|map(attribute=0)|list }}"

  tags:
  - packages

- name: Update all packages
  dnf:
    name: '*'
    state: latest
  tags:
  - update
  - packages

- name: Install packages
  dnf:
    name: '{{ item }}'
    state: present
  with_items: "{{ dnf_packages|dictsort(true)|selectattr(1,'equalto','present')|map(attribute=0)|list }}"
  tags:
  - packages

# vim: set ts=2 sw=2 et: