From 64dae322f06659a06a4030a3bc2d62a00d3f198b Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 15 Oct 2020 21:44:16 +0100 Subject: [PATCH] Set up a build environment in Ubuntu --- roles/ubuntu/files/pbuilderrc | 4 ++++ roles/ubuntu/tasks/build-env.yml | 29 +++++++++++++++++++++++++++++ roles/ubuntu/tasks/main.yml | 1 + roles/ubuntu/tasks/packages-cli.yml | 1 - 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 roles/ubuntu/files/pbuilderrc create mode 100644 roles/ubuntu/tasks/build-env.yml diff --git a/roles/ubuntu/files/pbuilderrc b/roles/ubuntu/files/pbuilderrc new file mode 100644 index 0000000..1fb0038 --- /dev/null +++ b/roles/ubuntu/files/pbuilderrc @@ -0,0 +1,4 @@ +AUTO_DEBSIGN=${AUTO_DEBSIGN:-no} +HOOKDIR=/var/cache/pbuilder/hooks +DISTRIBUTION=${DISTRIBUTION:-focal} +DEBOOTSTRAPOPTS=( '--variant=buildd' ) diff --git a/roles/ubuntu/tasks/build-env.yml b/roles/ubuntu/tasks/build-env.yml new file mode 100644 index 0000000..d2a72bd --- /dev/null +++ b/roles/ubuntu/tasks/build-env.yml @@ -0,0 +1,29 @@ +--- +- name: Install build environment packages + become: true + apt: + name: '{{ packages }}' + state: present + force_apt_get: yes + vars: + packages: + - build-essential + - debhelper + - debootstrap + - devscripts + - dh-make + - fakeroot + - pbuilder +- name: Copy pbuilderrc + become: true + copy: + src: pbuilderrc + dest: /etc/pbuilderrc +- name: Set permissions on /var/cache/pbuilder/result + become: true + file: + path: /var/cache/pbuilder/result + state: directory + owner: root + group: root + mode: '1777' diff --git a/roles/ubuntu/tasks/main.yml b/roles/ubuntu/tasks/main.yml index 200b3c0..a301df5 100644 --- a/roles/ubuntu/tasks/main.yml +++ b/roles/ubuntu/tasks/main.yml @@ -2,5 +2,6 @@ - include: packages-cli.yml - include: packages-gui.yml when: gui == true +- include: build-env.yml - include: modules.yml - include: ssh.yml diff --git a/roles/ubuntu/tasks/packages-cli.yml b/roles/ubuntu/tasks/packages-cli.yml index e2a8db2..b6ad5b7 100644 --- a/roles/ubuntu/tasks/packages-cli.yml +++ b/roles/ubuntu/tasks/packages-cli.yml @@ -25,7 +25,6 @@ - nmap - openssh-server - packagekit - - pbuilder - python3 - python3-psutil - ruby-asciidoctor-pdf