From 7c60ca302d8fabd44e47bce2bfc3fa91797af929 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Thu, 8 Dec 2022 16:38:54 -0800 Subject: [PATCH] added make and playbook for installation --- Makefile | 26 ++++++++++++++++++++++++++ install.yml | 22 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Makefile create mode 100644 install.yml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e9e7aab --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +PKGNAME = uacme +SPECFILE = $(PKGNAME).spec +ARCH = $(shell rpm --eval "%{_arch}") +RPMBUILD = $(shell rpm --eval "%{_builddir}") +RPMSOURCE = $(shell rpm --eval "%{_sourcedir}") +RPMDIR = $(shell rpm --eval "%{_rpmdir}") + +version = $(shell egrep "^Version" $(SPECFILE) | awk '{ print $$2}') +release = $(shell egrep "^Release" $(SPECFILE) | awk '{ print $$2}') + +sourceurl = https://github.com/ndilieto/uacme/archive/refs/tags/upstream/$(version).tar.gz +source = $(RPMSOURCE)/$(version).tar.gz + +RPM = $(RPMDIR)/$(ARCH)/$(PKGNAME)-$(version)-$(release).$(ARCH).rpm + + +$(RPM): $(SPECFILE) $(source) + rpmbuild -bb $< + +$(source): + wget -O $@ $(sourceurl) + +clean: + rm $(RPM) $(source) + +.PHONY: clean diff --git a/install.yml b/install.yml new file mode 100644 index 0000000..c5d130d --- /dev/null +++ b/install.yml @@ -0,0 +1,22 @@ +--- +- name: Install uacme rpm package + hosts: linodes + vars: + rpm_location: /home/thrrgilag/rpmbuild/RPMS/x86_64 + rpm_file: uacme-1.7.3-1.x86_64.rpm + + tasks: + - name: ping host + ansible.builtin.ping: + + - name: upload rpm + ansible.builtin.copy: + src: "{{ rpm_location }}/{{ rpm_file }}" + dest: /tmp + + - name: install rpm + ansible.builtin.dnf: + name: /tmp/{{ rpm_file }} + state: latest + disable_gpg_check: yes + become: yes