[libvirt] [jenkins-ci PATCH 2/5] guests: Remove distinction between files and templates

Andrea Bolognani abologna at redhat.com
Mon May 21 16:53:24 UTC 2018


The main difference between files and templates is that the
former can can be uploaded as-is, while the latter has to
go through Jinja2 first.

Since the overhead of template processing is negligible, and
there's a fair chance we will need to start using templating
for files that currently don't need it or viceversa, let's
get rid of the distinction altogether.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 guests/tasks/base.yml                                | 12 ++++++------
 guests/tasks/users.yml                               |  4 ++--
 .../{files/ccache.conf => templates/ccache.conf.j2}  |  0
 .../fedora-rawhide-kernel-nodebug.repo.j2}           |  0
 .../jessie-backports.preferences.j2}                 |  0
 .../jessie-backports.sources.j2}                     |  0
 6 files changed, 8 insertions(+), 8 deletions(-)
 rename guests/{files/ccache.conf => templates/ccache.conf.j2} (100%)
 rename guests/{files/fedora-rawhide-kernel-nodebug.repo => templates/fedora-rawhide-kernel-nodebug.repo.j2} (100%)
 rename guests/{files/jessie-backports.preferences => templates/jessie-backports.preferences.j2} (100%)
 rename guests/{files/jessie-backports.sources => templates/jessie-backports.sources.j2} (100%)

diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index 70d5abc..aac5d4f 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -67,8 +67,8 @@
         os_name == 'Fedora' )
 
 - name: Enable jessie-backports repository
-  copy:
-    src: files/jessie-backports.sources
+  template:
+    src: templates/jessie-backports.sources.j2
     dest: /etc/apt/sources.list.d/jessie-backports.list
     owner: root
     group: root
@@ -78,8 +78,8 @@
     - flavor == 'jenkins'
 
 - name: Configure APT pinning for jessie-backports
-  copy:
-    src: files/jessie-backports.preferences
+  template:
+    src: templates/jessie-backports.preferences.j2
     dest: /etc/apt/preferences.d/jessie-backports
     owner: root
     group: root
@@ -89,8 +89,8 @@
     - flavor == 'jenkins'
 
 - name: Enable fedora-rawhide-kernel-nodebug repository
-  copy:
-    src: files/fedora-rawhide-kernel-nodebug.repo
+  template:
+    src: templates/fedora-rawhide-kernel-nodebug.repo.j2
     dest: /etc/yum.repos.d/fedora-rawhide-kernel-nodebug.repo
     owner: root
     group: root
diff --git a/guests/tasks/users.yml b/guests/tasks/users.yml
index 7b37842..9c5c34d 100644
--- a/guests/tasks/users.yml
+++ b/guests/tasks/users.yml
@@ -62,8 +62,8 @@
     - ccache/bin
 
 - name: '{{ flavor }}: Configure ccache'
-  copy:
-    src: files/ccache.conf
+  template:
+    src: templates/ccache.conf.j2
     dest: /home/{{ flavor }}/.ccache/ccache.conf
     owner: '{{ flavor }}'
     group: '{{ flavor }}'
diff --git a/guests/files/ccache.conf b/guests/templates/ccache.conf.j2
similarity index 100%
rename from guests/files/ccache.conf
rename to guests/templates/ccache.conf.j2
diff --git a/guests/files/fedora-rawhide-kernel-nodebug.repo b/guests/templates/fedora-rawhide-kernel-nodebug.repo.j2
similarity index 100%
rename from guests/files/fedora-rawhide-kernel-nodebug.repo
rename to guests/templates/fedora-rawhide-kernel-nodebug.repo.j2
diff --git a/guests/files/jessie-backports.preferences b/guests/templates/jessie-backports.preferences.j2
similarity index 100%
rename from guests/files/jessie-backports.preferences
rename to guests/templates/jessie-backports.preferences.j2
diff --git a/guests/files/jessie-backports.sources b/guests/templates/jessie-backports.sources.j2
similarity index 100%
rename from guests/files/jessie-backports.sources
rename to guests/templates/jessie-backports.sources.j2
-- 
2.17.0




More information about the libvir-list mailing list