Merge pull request #123 from scottslowe/pulumi

Add Ansible role to create Pulumi environment
This commit is contained in:
Scott S. Lowe 2019-03-27 20:58:10 -06:00 committed by GitHub
commit 299c06b6ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,5 @@
## Ansible Role for a Pulumi Environment
This directory contains an [Ansible](https://www.ansible.com/) role for setting up a working environment for [Pulumi](https://pulumi.io). Using this role allows users to easily create working environments for Pulumi using a local hypervisor or a cloud instance.
To use this role, simply add the path to the role to the `roles:` section of your Ansible playbook.

View file

@ -0,0 +1,9 @@
---
pulumi_package_files:
- pulumi
- pulumi-language-go
- pulumi-language-nodejs
- pulumi-language-python
- pulumi-language-python-exec
- pulumi-resource-pulumi-nodejs
pulumi_download_url: "https://get.pulumi.com/releases/sdk"

View file

@ -0,0 +1,37 @@
---
- name: Download the Pulumi installation tarball
unarchive:
remote_src: true
src: "{{ pulumi_download_url }}/pulumi-v{{ pulumi_version }}-linux-x64.tar.gz"
dest: "/tmp"
creates: "/usr/local/bin/pulumi"
register: pulumi_downloaded
- name: Move Pulumi binaries into path
copy:
remote_src: true
src: "/tmp/pulumi/{{ item }}"
dest: "/usr/local/bin/{{ item }}"
with_items: "{{ pulumi_package_files }}"
when: pulumi_downloaded is changed
register: pulumi_copied
- name: Set permissions on Pulumi binaries
file:
dest: "/usr/local/bin/{{ item }}"
mode: 0755
state: "file"
with_items: "{{ pulumi_package_files }}"
when: pulumi_copied is changed
- name: Update apt cache
apt:
update_cache: true
cache_valid_time: 3600
- name: Install NodeJS
apt:
name: "{{ item }}"
state: "latest"
with_items:
- nodejs

View file

@ -0,0 +1,2 @@
---
pulumi_version: "0.17.1"