vagrant-cosmic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/CHANGELOG.md +8 -0
  4. data/Docker/.dockerignore +2 -0
  5. data/Docker/Dockerfile +48 -0
  6. data/Docker/Dockerfile.chefdk_0_17 +49 -0
  7. data/Docker/Dockerfile.latest_dependencies +49 -0
  8. data/Docker/README.md +95 -0
  9. data/Docker/vac.ps1 +29 -0
  10. data/Docker/vac.sh +30 -0
  11. data/Gemfile +21 -0
  12. data/Gemfile.lock +187 -0
  13. data/LICENSE +8 -0
  14. data/README.md +409 -0
  15. data/Rakefile +106 -0
  16. data/build_rpm.sh +7 -0
  17. data/functional-tests/basic/Vagrantfile.basic_networking +34 -0
  18. data/functional-tests/basic/basic_spec.rb +15 -0
  19. data/functional-tests/networking/Vagrantfile.advanced_networking +106 -0
  20. data/functional-tests/networking/networking_spec.rb +14 -0
  21. data/functional-tests/rsync/Vagrantfile.advanced_networking +40 -0
  22. data/functional-tests/rsync/rsync_spec.rb +9 -0
  23. data/functional-tests/vmlifecycle/Vagrantfile.advanced_networking +64 -0
  24. data/functional-tests/vmlifecycle/vmlifecycle_spec.rb +25 -0
  25. data/lib/vagrant-cosmic/action/connect_cosmic.rb +47 -0
  26. data/lib/vagrant-cosmic/action/is_created.rb +18 -0
  27. data/lib/vagrant-cosmic/action/is_stopped.rb +18 -0
  28. data/lib/vagrant-cosmic/action/message_already_created.rb +16 -0
  29. data/lib/vagrant-cosmic/action/message_not_created.rb +16 -0
  30. data/lib/vagrant-cosmic/action/message_will_not_destroy.rb +16 -0
  31. data/lib/vagrant-cosmic/action/read_rdp_info.rb +42 -0
  32. data/lib/vagrant-cosmic/action/read_ssh_info.rb +70 -0
  33. data/lib/vagrant-cosmic/action/read_state.rb +38 -0
  34. data/lib/vagrant-cosmic/action/read_transport_info.rb +59 -0
  35. data/lib/vagrant-cosmic/action/read_winrm_info.rb +69 -0
  36. data/lib/vagrant-cosmic/action/run_instance.rb +819 -0
  37. data/lib/vagrant-cosmic/action/start_instance.rb +81 -0
  38. data/lib/vagrant-cosmic/action/stop_instance.rb +28 -0
  39. data/lib/vagrant-cosmic/action/terminate_instance.rb +208 -0
  40. data/lib/vagrant-cosmic/action/timed_provision.rb +21 -0
  41. data/lib/vagrant-cosmic/action/wait_for_state.rb +41 -0
  42. data/lib/vagrant-cosmic/action/warn_networks.rb +19 -0
  43. data/lib/vagrant-cosmic/action.rb +210 -0
  44. data/lib/vagrant-cosmic/capabilities/rdp.rb +12 -0
  45. data/lib/vagrant-cosmic/capabilities/winrm.rb +12 -0
  46. data/lib/vagrant-cosmic/config.rb +422 -0
  47. data/lib/vagrant-cosmic/errors.rb +27 -0
  48. data/lib/vagrant-cosmic/exceptions/exceptions.rb +15 -0
  49. data/lib/vagrant-cosmic/model/cosmic_resource.rb +51 -0
  50. data/lib/vagrant-cosmic/plugin.rb +82 -0
  51. data/lib/vagrant-cosmic/provider.rb +58 -0
  52. data/lib/vagrant-cosmic/service/cosmic_resource_service.rb +76 -0
  53. data/lib/vagrant-cosmic/util/timer.rb +17 -0
  54. data/lib/vagrant-cosmic/version.rb +5 -0
  55. data/lib/vagrant-cosmic.rb +17 -0
  56. data/locales/en.yml +131 -0
  57. data/spec/spec_helper.rb +53 -0
  58. data/spec/vagrant-cosmic/action/read_ssh_info_spec.rb +80 -0
  59. data/spec/vagrant-cosmic/action/retrieve_public_ip_port_spec.rb +94 -0
  60. data/spec/vagrant-cosmic/action/run_instance_spec.rb +573 -0
  61. data/spec/vagrant-cosmic/action/terminate_instance_spec.rb +207 -0
  62. data/spec/vagrant-cosmic/config_spec.rb +340 -0
  63. data/spec/vagrant-cosmic/model/cosmic_resource_spec.rb +95 -0
  64. data/spec/vagrant-cosmic/service/cosmic_resource_service_spec.rb +43 -0
  65. data/spec/vagrant-cosmic/support/be_a_resource.rb +6 -0
  66. data/vagrant-cosmic.gemspec +59 -0
  67. data/vagrant-cosmic.spec +42 -0
  68. metadata +218 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 26aaea2370c5f49acb4f4ac2213ee4abd1eff8b1b2da980901567f1ff3da8849
4
+ data.tar.gz: 90b320c724cf4287138ed8eeb8cf7b593c86a276c76d464f12bd7985ad0496a8
5
+ SHA512:
6
+ metadata.gz: 1a0e30e9aab64d7509ac072cdd97752e6ff0082e9379d611712ec641b90fe1ad7daef15a60d4f26b99ec1a7927fd2c3325366bfc3f99ea316ee220750cd2039f
7
+ data.tar.gz: 492681177543ceeaae27c150db202892e5149278b49f884dad671870dfbb21e379610f7ce9c0d5dcc6458f0f7126595b665fea86e749d03f100d34f0b1e19d24
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ # OS-specific
2
+ .DS_Store
3
+
4
+ # Bundler/Rubygems
5
+ *.gem
6
+ .bundle
7
+ pkg/*
8
+ tags
9
+
10
+ # Vagrant
11
+ .vagrant
12
+ Vagrantfile
13
+ coverage/*
14
+ vendor/*
15
+
16
+ # RubyMine
17
+ .idea/*
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Cosmic Vagrant plugin
2
+
3
+ This file is used to list changes made in each version of the `vagrant-cosmic` plugin.
4
+
5
+ ## 0.1.0 (2020-02-25)
6
+
7
+ - Forked plugin from [MissionCriticalCloud/vagrant-cloudstack](https://github.com/MissionCriticalCloud/vagrant-cloudstack) and renamed to `vagrant-cosmic`
8
+ - Removed Security Group functionality as it's no longer supported by the [Cosmic API](http://apidoc.mcc.schubergphilis.com)
@@ -0,0 +1,2 @@
1
+ vac.sh
2
+ vac.ps1
data/Docker/Dockerfile ADDED
@@ -0,0 +1,48 @@
1
+ FROM debian:8
2
+
3
+ MAINTAINER Bob van den Heuvel <bvandenheuvel@schubergphilis.com>
4
+
5
+ # Specific older chef-dk required due to bundler version, only available as Debian 6 package
6
+ ENV CHEFDK_VERSION 1.2.22
7
+ ENV CHEFDK_DEB_VERSION 8
8
+
9
+ # Currently the latest version of the plugin has been tested with Vagrant 1.8.1
10
+ ENV VAGRANT_VERSION 1.9.3
11
+
12
+ # Update before all package installations
13
+ RUN apt-get update -y && \
14
+ apt-get install -y build-essential liblzma-dev zlib1g-dev git openssh-client curl && \
15
+ ln -sf bash /bin/sh
16
+
17
+ # Set the locale, seems to be required for all things gem
18
+ RUN apt-get install -y locales && \
19
+ dpkg-reconfigure -f noninteractive tzdata && \
20
+ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
21
+ echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
22
+ dpkg-reconfigure --frontend=noninteractive locales && \
23
+ update-locale LANG=en_US.UTF-8
24
+ # Set environment variables AFTER configuration, else breaks
25
+ ENV LANG en_US.UTF-8
26
+ ENV LANGUAGE en_US:en
27
+ ENV LC_ALL en_US.UTF-8
28
+ #
29
+
30
+ # install vagrant and the vagrant-cosmic plugin
31
+ RUN curl -L https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb > /tmp/vagrant_x86_64.deb && \
32
+ dpkg -i /tmp/vagrant_x86_64.deb && \
33
+ rm -f /tmp/vagrant_x86_64.deb && \
34
+ vagrant plugin install vagrant-cosmic && \
35
+ vagrant plugin install vagrant-winrm --plugin-version 0.7.0
36
+
37
+ RUN curl -L https://packages.chef.io/stable/debian/${CHEFDK_DEB_VERSION}/chefdk_${CHEFDK_VERSION}-1_amd64.deb > /tmp/chef_dk.deb && \
38
+ dpkg -i /tmp/chef_dk.deb && rm /tmp/chef_dk.deb && \
39
+ rm -f /tmp/chef_dk.deb && \
40
+ echo 'eval "$(chef shell-init bash)"' >> ~/.bashrc && \
41
+ /opt/chefdk/embedded/bin/bundler config --global path vendor/bundle && \
42
+ /opt/chefdk/embedded/bin/bundler config --global bin vendor/bin && \
43
+ /opt/chefdk/embedded/bin/gem install kitchen-vagrant -v 0.20.0
44
+
45
+
46
+ WORKDIR "/work"
47
+
48
+ VOLUME ["/work"]
@@ -0,0 +1,49 @@
1
+ FROM debian:8
2
+
3
+ MAINTAINER Bob van den Heuvel <bvandenheuvel@schubergphilis.com>
4
+
5
+ # Specify the ChefDK version and channel
6
+ ENV CHEFDK_VERSION 0.17
7
+ ENV CHEFDK_CHANNEL stable
8
+
9
+ # Currently the latest version of the plugin has been tested with Vagrant 1.8.1
10
+ ENV VAGRANT_VERSION 1.8.1
11
+
12
+ # The plugin currently depends on existence of the USER variable...
13
+ ENV USER VAC
14
+
15
+ # Update before all package installations
16
+ RUN apt-get update -y && \
17
+ apt-get install -y build-essential liblzma-dev zlib1g-dev git openssh-client curl && \
18
+ ln -sf bash /bin/sh
19
+
20
+ # Set the locale, seems to be required for all things gem
21
+ RUN apt-get install -y locales && \
22
+ dpkg-reconfigure -f noninteractive tzdata && \
23
+ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
24
+ echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
25
+ dpkg-reconfigure --frontend=noninteractive locales && \
26
+ update-locale LANG=en_US.UTF-8
27
+ # Set environment variables AFTER configuration, else breaks
28
+ ENV LANG en_US.UTF-8
29
+ ENV LANGUAGE en_US:en
30
+ ENV LC_ALL en_US.UTF-8
31
+ #
32
+
33
+ # Install vagrant and the vagrant-cosmic plugin
34
+ RUN curl -L https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb > /tmp/vagrant_x86_64.deb && \
35
+ dpkg -i /tmp/vagrant_x86_64.deb && \
36
+ rm -f /tmp/vagrant_x86_64.deb && \
37
+ vagrant plugin install vagrant-cosmic && \
38
+ vagrant plugin install vagrant-winrm --plugin-version 0.7.0
39
+
40
+ # Install ChefDK
41
+ RUN curl https://omnitruck.chef.io/install.sh | bash -s -- -c ${CHEFDK_CHANNEL} -P chefdk -v ${CHEFDK_VERSION} && \
42
+ echo 'eval "$(chef shell-init bash)"' >> ~/.bashrc && \
43
+ /opt/chefdk/embedded/bin/bundler config --global path vendor/bundle && \
44
+ /opt/chefdk/embedded/bin/bundler config --global bin vendor/bin && \
45
+ /opt/chefdk/embedded/bin/gem install kitchen-vagrant -v 0.20.0
46
+
47
+ WORKDIR "/work"
48
+
49
+ VOLUME ["/work"]
@@ -0,0 +1,49 @@
1
+ FROM debian:8
2
+
3
+ MAINTAINER Bob van den Heuvel <bvandenheuvel@schubergphilis.com>
4
+
5
+ # Specify the ChefDK version and channel
6
+ ENV CHEFDK_VERSION 0.19
7
+ ENV CHEFDK_CHANNEL stable
8
+
9
+ # Currently the latest version of the plugin has been tested with Vagrant 1.8.1
10
+ ENV VAGRANT_VERSION 1.8.1
11
+
12
+ # The plugin currently depends on existence of the USER variable...
13
+ ENV USER VAC
14
+
15
+ # Update before all package installations
16
+ RUN apt-get update -y && \
17
+ apt-get install -y build-essential liblzma-dev zlib1g-dev git openssh-client curl && \
18
+ ln -sf bash /bin/sh
19
+
20
+ # Set the locale, seems to be required for all things gem
21
+ RUN apt-get install -y locales && \
22
+ dpkg-reconfigure -f noninteractive tzdata && \
23
+ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
24
+ echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
25
+ dpkg-reconfigure --frontend=noninteractive locales && \
26
+ update-locale LANG=en_US.UTF-8
27
+ # Set environment variables AFTER configuration, else breaks
28
+ ENV LANG en_US.UTF-8
29
+ ENV LANGUAGE en_US:en
30
+ ENV LC_ALL en_US.UTF-8
31
+ #
32
+
33
+ # Install vagrant and the vagrant-cosmic plugin
34
+ RUN curl -L https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb > /tmp/vagrant_x86_64.deb && \
35
+ dpkg -i /tmp/vagrant_x86_64.deb && \
36
+ rm -f /tmp/vagrant_x86_64.deb && \
37
+ vagrant plugin install vagrant-cosmic && \
38
+ vagrant plugin install vagrant-winrm --plugin-version 0.7.0
39
+
40
+ # Install ChefDK
41
+ RUN curl https://omnitruck.chef.io/install.sh | bash -s -- -c ${CHEFDK_CHANNEL} -P chefdk -v ${CHEFDK_VERSION} && \
42
+ echo 'eval "$(chef shell-init bash)"' >> ~/.bashrc && \
43
+ /opt/chefdk/embedded/bin/bundler config --global path vendor/bundle && \
44
+ /opt/chefdk/embedded/bin/bundler config --global bin vendor/bin && \
45
+ /opt/chefdk/embedded/bin/gem install kitchen-vagrant -v 0.20.0
46
+
47
+ WORKDIR "/work"
48
+
49
+ VOLUME ["/work"]
data/Docker/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Vagrant Cosmic Container
2
+
3
+ This container contains some tools commonly used with the vagrant-cosmic plugin
4
+
5
+ ## Features
6
+ * Run Vagrant with the plugin
7
+ * Run Test-Kitchen with the plugin
8
+ * Using Bundler, run Vagrant/Test-Kitchen with vagrant-cosmic from source
9
+
10
+ ## Usage
11
+ Retrieve the docker container:
12
+ ```
13
+ docker pull MissionCriticalCloud/vagrant-cosmic
14
+ ```
15
+ Change into the directory containing your project (Vagrantfile, .kitchen.yml), and execute:
16
+ ```
17
+ docker run -ti --rm -v $(pwd):/work MissionCriticalCloud/vagrant-cosmic /bin/bash
18
+ ```
19
+ This provides a bash shell (in the container) where you can execute e.g. Vagrant, Test-Kitchen, Bundler.
20
+
21
+ For use of Vagrantfile or .kitchen.yml files containing environment variables, environment variables need to be specified in the docker run, e.g.:
22
+ ```
23
+ docker run \
24
+ -e USER=${USER} \
25
+ -e COSMIC_API_KEY=${COSMIC_API_KEY} \
26
+ -e COSMIC_SECRET_KEY=${COSMIC_SECRET_KEY} \
27
+ -ti --rm -v $(pwd):/work MissionCriticalCloud/vagrant-cosmic /bin/bash
28
+ ```
29
+
30
+ For actual development of the plugin, a lot more variables are required. To this end you can use the [bash script `vac.sh`](https://raw.githubusercontent.com/MissionCriticalCloud/vagrant-cosmic/master/Docker/vac.sh) or [PowerShell script `vac.ps1`](https://raw.githubusercontent.com/MissionCriticalCloud/vagrant-cosmic/master/Docker/vac.ps1) in the git repo.
31
+
32
+ _Note on usage of SSH keyfile_: As the container is mounted on a specific folder (`$(pwd)`), the keyfile must be specified (by `SSH_KEY`) relative to, __and within__, the specified folder!
33
+
34
+ ## Version / Tag notes
35
+ ### Vagrant
36
+ Development of the plugin, means running Vagrant from source, in combination with the specific bundler version (conflict) between ChefDK and Vagrant and ruby version (conflict) between ChefDK and Vagrant, leads to the following version combination:
37
+
38
+ ## dev
39
+ The versions have been specifically tuned to provide a working set for development of the plugin. To this end also developer tools (e.g. make, g++) are installed to enable bundler to pull in and compile required gems.
40
+ So this one is _required_ for developing and testing the plugin from (latest, master) source.
41
+ * [Vagrant](http://www.vagrantup.com) 1.9.3
42
+ * [Vagrant-cosmic](https://github.com/MissionCriticalCloud/vagrant-cosmic) plugin _current_
43
+ * [Vagrant-winrm](https://github.com/criteo/vagrant-winrm) 0.7.0 (latest)
44
+ * [Chef-DK](https://downloads.chef.io/chef-dk/) 1.2.22
45
+ * [Kitchen-Vagrant](https://github.com/test-kitchen/kitchen-vagrant) 0.20.0
46
+
47
+ _As the container is build automatically on triggers, latest versions are latest at time of (re)build_
48
+
49
+
50
+ ## latest_dependencies
51
+ This may not work for everyone as we try to use latest, but also stable combination of versions.
52
+ For now building on top of the "dev" container, with Vagrant 1.8.1.
53
+ * [Vagrant](http://www.vagrantup.com) 1.8.1
54
+ * [Vagrant-cosmic](https://github.com/MissionCriticalCloud/vagrant-cosmic) plugin _current_
55
+ * [Vagrant-winrm](https://github.com/criteo/vagrant-winrm) 0.7.0 (latest)
56
+ * [Chef-DK](https://downloads.chef.io/chef-dk/) 0.19
57
+ * [Kitchen-Vagrant](https://github.com/test-kitchen/kitchen-vagrant) 0.20.0
58
+
59
+ _As the container is build automatically on triggers, latest versions are latest at time of (re)build_
60
+
61
+
62
+ ## chefdk_0_17
63
+ This will install chef-client 12.13.37 which is needed for some compatibility reasons.
64
+ * [Vagrant](http://www.vagrantup.com) 1.8.1
65
+ * [Vagrant-cosmic](https://github.com/MissionCriticalCloud/vagrant-cosmic) plugin _current_
66
+ * [Vagrant-winrm](https://github.com/criteo/vagrant-winrm) 0.7.0 (latest)
67
+ * [Chef-DK](https://downloads.chef.io/chef-dk/) 0.17
68
+ * [Kitchen-Vagrant](https://github.com/test-kitchen/kitchen-vagrant) 0.20.0
69
+
70
+ _As the container is build automatically on triggers, latest versions are latest at time of (re)build_
71
+
72
+
73
+ Links to the respective Dockerfiles:
74
+ * [dev](https://raw.githubusercontent.com/MissionCriticalCloud/vagrant-cosmic/master/Docker/Dockerfile)
75
+ * [latest_dependencies](https://raw.githubusercontent.com/MissionCriticalCloud/vagrant-cosmic/master/Docker/Dockerfile.latest_dependencies)
76
+ * [chefdk_0_17](https://raw.githubusercontent.com/MissionCriticalCloud/vagrant-cosmic/master/Docker/Dockerfile.chefdk_0_17)
77
+
78
+ ## Additional notes on versions of used packages
79
+ ### Kitchen-Vagrant plugin
80
+ Due to new functionality in this plugin (0.21.0), using existing features, the plugin creates a Vagrantfile which has problems executing. This possibly revealed bugs in Vagrant, which might be fixed in newer Vagrant versions.
81
+ Untill a new Vagrant is in use, this plugin will be pinned to the latest working combination.
82
+
83
+ Bugs reported to kitchen-vagrant:
84
+ * [Windows: The shared folder guest path must be absolute: $env:TEMPomnibusche #256](https://github.com/test-kitchen/kitchen-vagrant/issues/256)
85
+ * [Problem with synced_folder (on Kubernetes) v0.20.0->v0.21.0 #257](https://github.com/test-kitchen/kitchen-vagrant/issues/257)
86
+
87
+
88
+ all containers:
89
+ * Kitchen-Vagrant 0.20.0
90
+
91
+ ### Vagrant-WinRM
92
+ Latest (tested) version at moment of writing is 0.7.0
93
+
94
+ all containers:
95
+ * Kitchen-Vagrant 0.7.0
data/Docker/vac.ps1 ADDED
@@ -0,0 +1,29 @@
1
+ docker run `
2
+ -e USER=$env:USERNAME `
3
+ -e COSMIC_API_KEY=$env:COSMIC_API_KEY `
4
+ -e COSMIC_SECRET_KEY=$env:COSMIC_SECRET_KEY `
5
+ -e COSMIC_HOST=$env:COSMIC_HOST `
6
+ -e ZONE_NAME=$env:ZONE_NAME `
7
+ -e SERVICE_OFFERING_NAME=$env:SERVICE_OFFERING_NAME `
8
+ -e VPC_PUBLIC_IP=$env:VPC_PUBLIC_IP `
9
+ -e VPC_TIER_NAME=$env:VPC_TIER_NAME `
10
+ -e VR_PUBLIC_IP=$env:VR_PUBLIC_IP `
11
+ -e VR_NETWORK_NAME=$env:VR_NETWORK_NAME `
12
+ -e NETWORK_NAME=$env:NETWORK_NAME `
13
+ -e PUBLIC_SOURCE_NAT_IP=$env:PUBLIC_SOURCE_NAT_IP `
14
+ -e OPEN_FIREWALL=$env:OPEN_FIREWALL `
15
+ -e PUBLIC_SSH_PORT=$env:PUBLIC_SSH_PORT `
16
+ -e PRIVATE_SSH_PORT=$env:PRIVATE_SSH_PORT `
17
+ -e PUBLIC_WINRM_PORT=$env:PUBLIC_WINRM_PORT `
18
+ -e PRIVATE_WINRM_PORT=$env:PRIVATE_WINRM_PORT `
19
+ -e SSH_USER=$env:SSH_USER `
20
+ -e SSH_KEY=/work/$env:SSH_KEY `
21
+ -e WINDOWS_USER=$env:WINDOWS_USER `
22
+ -e LINUX_TEMPLATE_NAME=$env:LINUX_TEMPLATE_NAME `
23
+ -e WINDOWS_TEMPLATE_NAME=$env:WINDOWS_TEMPLATE_NAME `
24
+ -e SOURCE_CIDR=$env:SOURCE_CIDR `
25
+ -e TRUSTED_NETWORKS=$env:TRUSTED_NETWORKS `
26
+ -e KITCHEN_LOCAL_YAML=$env:KITCHEN_LOCAL_YAML `
27
+ -e DISK_OFFERING_NAME=$env:DISK_OFFERING_NAME `
28
+ -e EXPUNGE_ON_DESTROY=$env:EXPUNGE_ON_DESTROY `
29
+ -ti --rm -v "$( $(pwd) -replace '\\', '/'):/work" MissionCriticalCloud/vagrant-cosmic /bin/bash
data/Docker/vac.sh ADDED
@@ -0,0 +1,30 @@
1
+ #!/bin/sh
2
+ docker run \
3
+ -e USER=${USER} \
4
+ -e COSMIC_API_KEY=${COSMIC_API_KEY} \
5
+ -e COSMIC_SECRET_KEY=${COSMIC_SECRET_KEY} \
6
+ -e COSMIC_HOST=${COSMIC_HOST} \
7
+ -e ZONE_NAME=${ZONE_NAME} \
8
+ -e SERVICE_OFFERING_NAME=${SERVICE_OFFERING_NAME} \
9
+ -e VPC_PUBLIC_IP=${VPC_PUBLIC_IP} \
10
+ -e VPC_TIER_NAME=${VPC_TIER_NAME} \
11
+ -e VR_PUBLIC_IP=${VR_PUBLIC_IP} \
12
+ -e VR_NETWORK_NAME=${VR_NETWORK_NAME} \
13
+ -e NETWORK_NAME=${NETWORK_NAME} \
14
+ -e PUBLIC_SOURCE_NAT_IP=${PUBLIC_SOURCE_NAT_IP} \
15
+ -e OPEN_FIREWALL=${OPEN_FIREWALL} \
16
+ -e PUBLIC_SSH_PORT=${PUBLIC_SSH_PORT} \
17
+ -e PRIVATE_SSH_PORT=${PRIVATE_SSH_PORT} \
18
+ -e PUBLIC_WINRM_PORT=${PUBLIC_WINRM_PORT} \
19
+ -e PRIVATE_WINRM_PORT=${PRIVATE_WINRM_PORT} \
20
+ -e SSH_USER=${SSH_USER} \
21
+ -e SSH_KEY=/work/${SSH_KEY} \
22
+ -e WINDOWS_USER=${WINDOWS_USER} \
23
+ -e LINUX_TEMPLATE_NAME=${LINUX_TEMPLATE_NAME} \
24
+ -e WINDOWS_TEMPLATE_NAME=${WINDOWS_TEMPLATE_NAME} \
25
+ -e SOURCE_CIDR=${SOURCE_CIDR} \
26
+ -e TRUSTED_NETWORKS=${TRUSTED_NETWORKS} \
27
+ -e KITCHEN_LOCAL_YAML=${KITCHEN_LOCAL_YAML} \
28
+ -e DISK_OFFERING_NAME=${DISK_OFFERING_NAME} \
29
+ -e EXPUNGE_ON_DESTROY=${EXPUNGE_ON_DESTROY} \
30
+ -ti --rm -v $(pwd):/work MissionCriticalCloud/vagrant-cosmic /bin/bash
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ # We depend on Vagrant for development, but we don't add it as a
7
+ # gem dependency because we expect to be installed within the
8
+ # Vagrant environment itself using `vagrant plugin`.
9
+ gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git', ref: "v2.2.4"
10
+ gem 'coveralls', require: false
11
+ gem 'pry'
12
+ gem 'rspec-core'
13
+ gem 'rspec-expectations'
14
+ gem 'rspec-its'
15
+ gem 'rspec-mocks'
16
+ gem 'simplecov', require: false
17
+ end
18
+
19
+ group :plugins do
20
+ gemspec
21
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,187 @@
1
+ GIT
2
+ remote: https://github.com/hashicorp/vagrant.git
3
+ revision: 25e11650c3c6b1a2d461ef055aabacb8562b265b
4
+ ref: v2.2.4
5
+ specs:
6
+ vagrant (2.2.4)
7
+ bcrypt_pbkdf (~> 1.0.0)
8
+ childprocess (~> 0.6.0)
9
+ ed25519 (~> 1.2.4)
10
+ erubis (~> 2.7.0)
11
+ hashicorp-checkpoint (~> 0.1.5)
12
+ i18n (~> 1.1.1)
13
+ listen (~> 3.1.5)
14
+ log4r (~> 1.1.9, < 1.1.11)
15
+ net-scp (~> 1.2.0)
16
+ net-sftp (~> 2.1)
17
+ net-ssh (~> 5.1.0)
18
+ rb-kqueue (~> 0.2.0)
19
+ rest-client (>= 1.6.0, < 3.0)
20
+ ruby_dep (<= 1.3.1)
21
+ rubyzip (~> 1.2.2)
22
+ vagrant_cloud (~> 2.0.2)
23
+ wdm (~> 0.1.0)
24
+ winrm (~> 2.1)
25
+ winrm-elevated (~> 1.1)
26
+ winrm-fs (~> 1.0)
27
+
28
+ PATH
29
+ remote: .
30
+ specs:
31
+ vagrant-cosmic (0.1.0)
32
+ fog-cosmic (~> 0.1.0)
33
+
34
+ GEM
35
+ remote: https://rubygems.org/
36
+ specs:
37
+ bcrypt_pbkdf (1.0.1)
38
+ builder (3.2.4)
39
+ childprocess (0.6.3)
40
+ ffi (~> 1.0, >= 1.0.11)
41
+ coderay (1.1.2)
42
+ concurrent-ruby (1.1.6)
43
+ coveralls (0.7.1)
44
+ multi_json (~> 1.3)
45
+ rest-client
46
+ simplecov (>= 0.7)
47
+ term-ansicolor
48
+ thor
49
+ diff-lcs (1.3)
50
+ docile (1.3.2)
51
+ domain_name (0.5.20190701)
52
+ unf (>= 0.0.5, < 1.0.0)
53
+ ed25519 (1.2.4)
54
+ erubi (1.9.0)
55
+ erubis (2.7.0)
56
+ excon (0.72.0)
57
+ ffi (1.12.2)
58
+ fog-core (2.2.0)
59
+ builder
60
+ excon (~> 0.71)
61
+ formatador (~> 0.2)
62
+ mime-types
63
+ fog-cosmic (0.1.0)
64
+ fog-core (~> 2.1)
65
+ fog-json (~> 1.1)
66
+ fog-xml (~> 0.1)
67
+ fog-json (1.2.0)
68
+ fog-core
69
+ multi_json (~> 1.10)
70
+ fog-xml (0.1.3)
71
+ fog-core
72
+ nokogiri (>= 1.5.11, < 2.0.0)
73
+ formatador (0.2.5)
74
+ gssapi (1.3.0)
75
+ ffi (>= 1.0.1)
76
+ gyoku (1.3.1)
77
+ builder (>= 2.1.2)
78
+ hashicorp-checkpoint (0.1.5)
79
+ http-cookie (1.0.3)
80
+ domain_name (~> 0.5)
81
+ httpclient (2.8.3)
82
+ i18n (1.1.1)
83
+ concurrent-ruby (~> 1.0)
84
+ listen (3.1.5)
85
+ rb-fsevent (~> 0.9, >= 0.9.4)
86
+ rb-inotify (~> 0.9, >= 0.9.7)
87
+ ruby_dep (~> 1.2)
88
+ little-plugger (1.1.4)
89
+ log4r (1.1.10)
90
+ logging (2.2.2)
91
+ little-plugger (~> 1.1)
92
+ multi_json (~> 1.10)
93
+ method_source (0.9.2)
94
+ mime-types (3.3.1)
95
+ mime-types-data (~> 3.2015)
96
+ mime-types-data (3.2019.1009)
97
+ mini_portile2 (2.4.0)
98
+ multi_json (1.14.1)
99
+ net-scp (1.2.1)
100
+ net-ssh (>= 2.6.5)
101
+ net-sftp (2.1.2)
102
+ net-ssh (>= 2.6.5)
103
+ net-ssh (5.1.0)
104
+ netrc (0.11.0)
105
+ nokogiri (1.10.8)
106
+ mini_portile2 (~> 2.4.0)
107
+ nori (2.6.0)
108
+ pry (0.12.2)
109
+ coderay (~> 1.1.0)
110
+ method_source (~> 0.9.0)
111
+ rake (10.5.0)
112
+ rb-fsevent (0.10.3)
113
+ rb-inotify (0.10.1)
114
+ ffi (~> 1.0)
115
+ rb-kqueue (0.2.5)
116
+ ffi (>= 0.5.0)
117
+ rest-client (2.0.2)
118
+ http-cookie (>= 1.0.2, < 2.0)
119
+ mime-types (>= 1.16, < 4.0)
120
+ netrc (~> 0.8)
121
+ rspec-core (3.9.1)
122
+ rspec-support (~> 3.9.1)
123
+ rspec-expectations (3.9.0)
124
+ diff-lcs (>= 1.2.0, < 2.0)
125
+ rspec-support (~> 3.9.0)
126
+ rspec-its (1.3.0)
127
+ rspec-core (>= 3.0.0)
128
+ rspec-expectations (>= 3.0.0)
129
+ rspec-mocks (3.9.1)
130
+ diff-lcs (>= 1.2.0, < 2.0)
131
+ rspec-support (~> 3.9.0)
132
+ rspec-support (3.9.2)
133
+ ruby_dep (1.3.1)
134
+ rubyntlm (0.6.2)
135
+ rubyzip (1.2.4)
136
+ simplecov (0.18.5)
137
+ docile (~> 1.1)
138
+ simplecov-html (~> 0.11)
139
+ simplecov-html (0.12.1)
140
+ sync (0.5.0)
141
+ term-ansicolor (1.7.1)
142
+ tins (~> 1.0)
143
+ thor (1.0.1)
144
+ tins (1.24.1)
145
+ sync
146
+ unf (0.1.4)
147
+ unf_ext
148
+ unf_ext (0.0.7.6)
149
+ vagrant_cloud (2.0.3)
150
+ rest-client (~> 2.0.2)
151
+ wdm (0.1.1)
152
+ winrm (2.3.4)
153
+ builder (>= 2.1.2)
154
+ erubi (~> 1.8)
155
+ gssapi (~> 1.2)
156
+ gyoku (~> 1.0)
157
+ httpclient (~> 2.2, >= 2.2.0.2)
158
+ logging (>= 1.6.1, < 3.0)
159
+ nori (~> 2.0)
160
+ rubyntlm (~> 0.6.0, >= 0.6.1)
161
+ winrm-elevated (1.2.1)
162
+ erubi (~> 1.8)
163
+ winrm (~> 2.0)
164
+ winrm-fs (~> 1.0)
165
+ winrm-fs (1.3.3)
166
+ erubi (~> 1.8)
167
+ logging (>= 1.6.1, < 3.0)
168
+ rubyzip (~> 1.1)
169
+ winrm (~> 2.0)
170
+
171
+ PLATFORMS
172
+ ruby
173
+
174
+ DEPENDENCIES
175
+ coveralls
176
+ pry
177
+ rake (~> 10.5, >= 10.4)
178
+ rspec-core
179
+ rspec-expectations
180
+ rspec-its
181
+ rspec-mocks
182
+ simplecov
183
+ vagrant!
184
+ vagrant-cosmic!
185
+
186
+ BUNDLED WITH
187
+ 1.17.2
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2013 Mitchell Hashimoto
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.