From 6f7444f7040001d35cc0f145682f67199fbe4cd1 Mon Sep 17 00:00:00 2001 From: nre Date: Mon, 8 Jan 2018 15:53:50 +0000 Subject: [PATCH] Introduce new role: ableton.fastbuild This role installs FASTBuild on a Windows-based system. We could theoretically support Linux and Mac in the future, since FASTBuild supports those platforms (albeit in alpha). --- README.md | 27 +++++++++++++++++++++++++++ defaults/main.yml | 12 ++++++++++++ meta/main.yml | 22 ++++++++++++++++++++++ tasks/main.yml | 2 ++ tasks/windows/main.yml | 17 +++++++++++++++++ vars/main.yml | 3 +++ 6 files changed, 83 insertions(+) create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/main.yml create mode 100644 tasks/windows/main.yml create mode 100644 vars/main.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..4be539e --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +FASTBuild Role +============== + +This role installs the [FASTBuild][fastbuild] build system software on the given +Ansible host. + + +Supported Host OS Types +----------------------- + +Currently this role only supports Windows hosts, even though FASTBuild has alpha +support for Linux and Mac OS X. + + +Role Variables +-------------- + +This role defines the following variables which can be overridden: + +- `fastbuild_arch` +- `fastbuild_version` +- `fastbuild_path_win` + +See `defaults/main.yml` for further documentation of these variables. + + +[fastbuild]: http://fastbuild.org diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..fd1d6fb --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,12 @@ +--- +# Architecture to download for. Valid values include 'x64' and 'x86'. Note that +# the 'x86' (32-bit) variant is only supported for Windows, and is known to be +# slower than the 64-bit version. Unless you are running a 32-bit version of +# Windows, it is not advised to change this value. +fastbuild_arch: 'x64' + +# Version of FASTBuild to install. +fastbuild_version: '0.94' + +# On Windows, this determines where the FASTBuild executables will be extracted. +fastbuild_path_win: C:\Windows diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..d9f56d3 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,22 @@ +--- +galaxy_info: + author: Nik Reiman + description: Installs FASTBuild + company: Ableton AG + + license: BSD + + min_ansible_version: 1.2 + + github_branch: master + + platforms: + - name: Windows + versions: + - 8 + - 8.1 + - 10 + + galaxy_tags: [] + + dependencies: [] diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..8aae503 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: "{{ ansible_os_family | lower }}/main.yml" diff --git a/tasks/windows/main.yml b/tasks/windows/main.yml new file mode 100644 index 0000000..9602e6e --- /dev/null +++ b/tasks/windows/main.yml @@ -0,0 +1,17 @@ +--- +- name: Create temporary directory for downloads + win_tempfile: + state: directory + prefix: fastbuild + register: fastbuild_temp_dir + +- name: Download FASTBuild zipfile + win_get_url: + url: "{{ fastbuild_url_base }}/v{{ fastbuild_version }}/FASTBuild-Windows-{{ fastbuild_arch }}-v{{ fastbuild_version }}.zip" + dest: "{{ fastbuild_temp_dir.path }}/FASTBuild.zip" + +- name: Unzip FASTBuild archive + win_unzip: + src: "{{ fastbuild_temp_dir.path }}/FASTBuild.zip" + dest: "{{ fastbuild_path_win }}" + delete_archive: true diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..438cfe6 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,3 @@ +--- +# Base URL where the software will be downloaded from. +fastbuild_url_base: 'http://fastbuild.org/downloads'