From d6149d26d87973213d4f8b91a73642e40f51a65d Mon Sep 17 00:00:00 2001 From: Dirk Pahl Date: Mon, 13 Jan 2020 13:33:32 +0100 Subject: [PATCH] Introduce version property and bumpversion --- .bumpversion.cfg | 6 ++++++ playbooks/roles/debian9-hetzner/defaults/main.yml | 1 + playbooks/roles/debian9-hetzner/tasks/main.yml | 14 +++----------- 3 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..6928450 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,6 @@ +[bumpversion] +commit = True +tag = True +current_version = 1.0.0 + +[bumpversion:file:playbooks/roles/debian9-hetzner/defaults/main.yml] diff --git a/playbooks/roles/debian9-hetzner/defaults/main.yml b/playbooks/roles/debian9-hetzner/defaults/main.yml index 9b3eece..f79ab28 100644 --- a/playbooks/roles/debian9-hetzner/defaults/main.yml +++ b/playbooks/roles/debian9-hetzner/defaults/main.yml @@ -1,4 +1,5 @@ --- +hetzner_debian9_image_version: 1.0.0 intel_driver_module: e1000e intel_driver_version: 3.6.0 intel_driver_download_location: https://downloadmirror.intel.com/15817/eng/{{ intel_driver_module }}-{{ intel_driver_version }}.tar.gz diff --git a/playbooks/roles/debian9-hetzner/tasks/main.yml b/playbooks/roles/debian9-hetzner/tasks/main.yml index 95e97da..9f927e5 100644 --- a/playbooks/roles/debian9-hetzner/tasks/main.yml +++ b/playbooks/roles/debian9-hetzner/tasks/main.yml @@ -52,26 +52,18 @@ - name: Update grub config shell: update-grub -- name: Run command to get package timestamp - command: "date +%Y%m%d%H%M%S" - register: date_output - -- name: Set package timestamp name - set_fact: - package_timestamp: "{{ date_output.stdout }}" - - name: Create directory for image file: path: /osimage state: directory - name: Create OS image package - shell: tar zcvf Debian-911-stretch-64-custom-{{ package_timestamp }}.tar.gz /bin /boot /etc /home /lib /lib64 /media /mnt /opt /root /run /sbin /srv /tmp /usr /var + shell: tar zcvf Debian-911-stretch-64-custom-{{ hetzner_debian9_image_version }}.tar.gz /bin /boot /etc /home /lib /lib64 /media /mnt /opt /root /run /sbin /srv /tmp /usr /var args: chdir: /osimage - name: Move image file to /vagrant directory copy: - src: /osimage/Debian-911-stretch-64-custom-{{ package_timestamp }}.tar.gz - dest: /vagrant/Debian-911-stretch-64-custom-{{ package_timestamp }}.tar.gz + src: /osimage/Debian-911-stretch-64-custom-{{ hetzner_debian9_image_version }}.tar.gz + dest: /vagrant/Debian-911-stretch-64-custom-{{ hetzner_debian9_image_version }}.tar.gz remote_src: True