aboutsummaryrefslogtreecommitdiffstats
path: root/roles/fedora/tasks
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2017-11-07 16:27:49 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2017-11-12 14:56:32 +0100
commite8cdba85c48dcbbd42e6fcb5be3aa2912008cb84 (patch)
tree41ba5163cf6f110521f2ebc9035f77d2754796a0 /roles/fedora/tasks
downloadlabitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.tar.gz
labitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.tar.xz
labitat-ansible-e8cdba85c48dcbbd42e6fcb5be3aa2912008cb84.zip
initial commit
Diffstat (limited to 'roles/fedora/tasks')
-rw-r--r--roles/fedora/tasks/dnf.yml46
-rw-r--r--roles/fedora/tasks/hostname.yml12
-rw-r--r--roles/fedora/tasks/locale.yml7
-rw-r--r--roles/fedora/tasks/main.yml14
-rw-r--r--roles/fedora/tasks/timezone.yml9
5 files changed, 88 insertions, 0 deletions
diff --git a/roles/fedora/tasks/dnf.yml b/roles/fedora/tasks/dnf.yml
new file mode 100644
index 0000000..a0c0db9
--- /dev/null
+++ b/roles/fedora/tasks/dnf.yml
@@ -0,0 +1,46 @@
+---
+- name: Configure dnf.conf
+ ini_file:
+ path: /etc/dnf/dnf.conf
+ no_extra_spaces: yes
+ section: '{{ item.section }}'
+ option: '{{ item.option }}'
+ value: '{{ item.value }}'
+ with_items:
+ - section: main
+ option: 'install_weak_deps'
+ value: 'False'
+ - section: main
+ option: 'best'
+ value: 'True'
+ - section: main
+ option: 'deltarpm'
+ value: 'False'
+
+- name: Update all packages
+ dnf:
+ name: '*'
+ state: latest
+ tags:
+ - update
+ - packages
+
+- name: Remove packages
+ dnf:
+ name: '{{ item }}'
+ state: absent
+ with_items: '{{ packages.remove }}'
+ when: "'remove' in packages"
+ tags:
+ - packages
+
+- name: Install packages
+ dnf:
+ name: '{{ item }}'
+ state: latest
+ with_items: '{{ packages.install }}'
+ when: "'install' in packages"
+ tags:
+ - packages
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/fedora/tasks/hostname.yml b/roles/fedora/tasks/hostname.yml
new file mode 100644
index 0000000..5299270
--- /dev/null
+++ b/roles/fedora/tasks/hostname.yml
@@ -0,0 +1,12 @@
+---
+- name: Set hostname
+ hostname:
+ name: '{{ hostname }}'
+ when: "'container' not in ansible_env"
+- name: '- when in nspawn'
+ copy:
+ dest: /etc/hostname
+ content: "{{ hostname }}\n"
+ when: "'container' in ansible_env"
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/fedora/tasks/locale.yml b/roles/fedora/tasks/locale.yml
new file mode 100644
index 0000000..61311e0
--- /dev/null
+++ b/roles/fedora/tasks/locale.yml
@@ -0,0 +1,7 @@
+---
+- name: Setting default locales
+ template:
+ src: locale.conf.j2
+ dest: /etc/locale.conf
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/fedora/tasks/main.yml b/roles/fedora/tasks/main.yml
new file mode 100644
index 0000000..2e163a4
--- /dev/null
+++ b/roles/fedora/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- import_tasks: dnf.yml
+ tags: dnf
+- import_tasks: timezone.yml
+ when: timezone is defined
+ tags: timezone
+- import_tasks: locale.yml
+ when: locale is defined
+ tags: locale
+- import_tasks: hostname.yml
+ when: hostname is defined
+ tags: hostname
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/fedora/tasks/timezone.yml b/roles/fedora/tasks/timezone.yml
new file mode 100644
index 0000000..05a9165
--- /dev/null
+++ b/roles/fedora/tasks/timezone.yml
@@ -0,0 +1,9 @@
+---
+- name: Create /etc/localtime
+ file:
+ path: '/etc/localtime'
+ state: link
+ src: '../usr/share/zoneinfo/{{ timezone }}'
+ force: yes
+
+# vim: set ts=2 sw=2 et: