aboutsummaryrefslogblamecommitdiffstats
path: root/roles/fedora/tasks/dnf.yml
blob: 947785b82210fccc4aebdcf242342190e15332e2 (plain) (tree)
1
2
3
4
5
6
7

                          

                                                             
           
                             
                        





                                                           

                       

                                                                         
      
                                                                                                    
                 
       

            
                            



                 
           
            

                        

                                                                         
      
                                                                                                     
                         
                  
       
            
 







                                                             
                                                                                          
              
 
                        
---
- name: Configure dnf.conf
  vars:
    dnf_conf: '{{ dnf_conf_default|combine(dnf_conf_role) }}'
  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
  vars:
    dnf_packages: '{{ dnf_packages_default|combine(dnf_packages_role) }}'
  dnf:
    name: "{{ dnf_packages|dictsort(true)|selectattr(1,'equalto','absent')|map(attribute=0)|list }}"
    state: absent
  tags:
  - packages

- name: Upgrade all packages
  dnf:
    name: '*'
    state: latest
  tags:
  - upgrade
  - packages

- name: Install packages
  vars:
    dnf_packages: '{{ dnf_packages_default|combine(dnf_packages_role) }}'
  dnf:
    name: "{{ dnf_packages|dictsort(true)|selectattr(1,'equalto','present')|map(attribute=0)|list }}"
    install_weak_deps: no
    state: present
  tags:
  - packages

- name: Configure dnf-makecache timer
  systemd:
    name: dnf-makecache.timer
    enabled: "{{ dnf_makecache|ternary('yes','no') }}"
    masked: no
    state: "{{ dnf_makecache|ternary('started','stopped') }}"
  when: not chroot
- name: '- when in chroot'
  command: "systemctl {{ dnf_makecache|ternary('enable','disable') }} dnf-makecache.timer"
  when: chroot

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