wombat-cli 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.travis.yml +27 -0
- data/CHANGELOG.md +15 -1
- data/Gemfile +3 -0
- data/README.md +2 -2
- data/Rakefile +25 -0
- data/bin/wombat +1 -1
- data/generator_files/cookbooks/automate/metadata.rb +1 -1
- data/generator_files/cookbooks/automate/recipes/update-users.rb +1 -1
- data/generator_files/cookbooks/chef_server/recipes/default.rb +24 -11
- data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +2 -1
- data/generator_files/cookbooks/workstation/metadata.rb +1 -1
- data/generator_files/cookbooks/workstation/recipes/default.rb +1 -2
- data/generator_files/cookbooks/workstation/templates/default/ise_profile.ps1.erb +2 -2
- data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +4 -4
- data/generator_files/packer/automate.json +129 -107
- data/generator_files/packer/build-node.json +134 -112
- data/generator_files/packer/chef-server.json +130 -108
- data/generator_files/packer/compliance.json +126 -104
- data/generator_files/packer/infranodes-windows.json +136 -97
- data/generator_files/packer/infranodes.json +127 -106
- data/generator_files/packer/workstation.json +134 -95
- data/generator_files/templates/arm.json.erb +576 -0
- data/generator_files/wombat.yml +6 -2
- data/lib/wombat/aws.rb +67 -0
- data/lib/wombat/build.rb +273 -184
- data/lib/wombat/cli.rb +182 -147
- data/lib/wombat/common.rb +228 -220
- data/lib/wombat/crypto.rb +65 -0
- data/lib/wombat/delete.rb +48 -18
- data/lib/wombat/deploy.rb +147 -34
- data/lib/wombat/init.rb +21 -19
- data/lib/wombat/latest.rb +27 -0
- data/lib/wombat/output.rb +31 -30
- data/lib/wombat/update.rb +13 -10
- data/lib/wombat/version.rb +1 -1
- data/spec/functional/common_spec.rb +26 -0
- data/spec/spec_helper.rb +103 -0
- data/spec/unit/common_spec.rb +116 -0
- data/wombat-cli.gemspec +2 -1
- metadata +36 -11
- /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{delivery.crt → automate.crt} +0 -0
- /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{delivery.key → automate.key} +0 -0
- /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{chef-server.crt → chef.crt} +0 -0
- /data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/{chef-server.key → chef.key} +0 -0
@@ -1,109 +1,130 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"builders": [
|
31
|
-
{ "type": "amazon-ebs",
|
32
|
-
"access_key": "{{user `aws_access_key`}}",
|
33
|
-
"secret_key": "{{user `aws_secret_key`}}",
|
34
|
-
"region": "{{user `aws_region`}}",
|
35
|
-
"source_ami": "{{user `aws_source_ami`}}",
|
36
|
-
"instance_type": "t2.medium",
|
37
|
-
"communicator": "ssh",
|
38
|
-
"associate_public_ip_address": true,
|
39
|
-
"ssh_username": "{{user `ssh_username`}}",
|
40
|
-
"ssh_pty" : true,
|
41
|
-
"ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
|
2
|
+
"variables": {
|
3
|
+
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
|
4
|
+
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
|
5
|
+
"aws_region": "{{env `AWS_REGION`}}",
|
6
|
+
"aws_source_ami": "ami-8e0b9499",
|
7
|
+
"azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
|
8
|
+
"azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
|
9
|
+
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
|
10
|
+
"azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
|
11
|
+
"azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
|
12
|
+
"azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
|
13
|
+
"azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
|
14
|
+
"azure_location": "",
|
15
|
+
"gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
|
16
|
+
"gce_project_id": "{{env `GCE_PROJECT_ID`}}",
|
17
|
+
"gce_zone": "{{env `GCE_ZONE`}}",
|
18
|
+
"gce_source_image": "ubuntu-1404-trusty-v20160809a",
|
19
|
+
"build-nodes": "1",
|
20
|
+
"chef_channel": "stable",
|
21
|
+
"chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
|
22
|
+
"chef_ver": "latest",
|
23
|
+
"domain": "animals.biz",
|
24
|
+
"domain_prefix": "",
|
25
|
+
"enterprise": "mammals",
|
26
|
+
"node-name": "acceptance",
|
27
|
+
"org": "marsupials",
|
28
|
+
"ssh_username": "{{user `ssh_username`}}",
|
29
|
+
"workstations": "1"
|
42
30
|
},
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
31
|
+
"builders": [
|
32
|
+
{
|
33
|
+
"type": "amazon-ebs",
|
34
|
+
"access_key": "{{user `aws_access_key`}}",
|
35
|
+
"secret_key": "{{user `aws_secret_key`}}",
|
36
|
+
"region": "{{user `aws_region`}}",
|
37
|
+
"source_ami": "{{user `aws_source_ami`}}",
|
38
|
+
"instance_type": "t2.medium",
|
39
|
+
"communicator": "ssh",
|
40
|
+
"associate_public_ip_address": true,
|
41
|
+
"ssh_username": "{{user `ssh_username`}}",
|
42
|
+
"ssh_pty": true,
|
43
|
+
"ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"type": "azure-arm",
|
47
|
+
"subscription_id": "{{user `azure_subscription_id`}}",
|
48
|
+
"client_id": "{{user `azure_client_id`}}",
|
49
|
+
"client_secret": "{{user `azure_client_secret`}}",
|
50
|
+
"tenant_id": "{{user `azure_tenant_id`}}",
|
51
|
+
"resource_group_name": "{{user `azure_resource_group`}}",
|
52
|
+
"storage_account": "{{user `azure_storage_account`}}",
|
53
|
+
"object_id": "{{user `azure_object_id`}}",
|
54
|
+
"capture_container_name": "images",
|
55
|
+
"capture_name_prefix": "infranode-{{user `node-name`}}",
|
56
|
+
"os_type": "Linux",
|
57
|
+
"image_publisher": "Canonical",
|
58
|
+
"image_offer": "UbuntuServer",
|
59
|
+
"image_sku": "14.04.5-LTS",
|
60
|
+
"location": "{{user `azure_location`}}",
|
61
|
+
"vm_size": "Standard_DS3_v2",
|
62
|
+
"ssh_username": "{{user `ssh_username`}}",
|
63
|
+
"ssh_pty": true
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"type": "googlecompute",
|
67
|
+
"account_file": "{{user `gce_account_file`}}",
|
68
|
+
"project_id": "{{user `gce_project_id`}}",
|
69
|
+
"source_image": "{{user `gce_source_image`}}",
|
70
|
+
"zone": "{{user `gce_zone`}}",
|
71
|
+
"disk_type": "pd-ssd",
|
72
|
+
"disk_size": "80",
|
73
|
+
"image_name": "chef-{{timestamp}}",
|
74
|
+
"machine_type": "n1-standard-2",
|
75
|
+
"ssh_username": "{{user `ssh_username`}}",
|
76
|
+
"ssh_pty": true
|
77
|
+
}
|
78
|
+
],
|
79
|
+
"provisioners": [
|
80
|
+
{
|
81
|
+
"type": "file",
|
82
|
+
"source": "{{pwd}}/files/",
|
83
|
+
"destination": "/tmp"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"type": "file",
|
87
|
+
"source": "{{pwd}}/keys/",
|
88
|
+
"destination": "/tmp"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"type": "chef-solo",
|
92
|
+
"install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
|
93
|
+
"cookbook_paths": [
|
94
|
+
"{{pwd}}/vendored-cookbooks/infranodes"
|
95
|
+
],
|
96
|
+
"run_list": [
|
97
|
+
"infranodes",
|
98
|
+
"wombat::authorized-keys",
|
99
|
+
"wombat::etc-hosts"
|
100
|
+
],
|
101
|
+
"json": {
|
102
|
+
"demo": {
|
103
|
+
"admin-user": "{{user `ssh_username`}}",
|
104
|
+
"domain_prefix": "{{user `domain_prefix`}}",
|
105
|
+
"domain": "{{user `domain`}}",
|
106
|
+
"enterprise": "{{user `enterprise`}}",
|
107
|
+
"org": "{{user `org`}}",
|
108
|
+
"build-nodes": "{{user `build-nodes`}}",
|
109
|
+
"workstations": "{{user `workstations`}}",
|
110
|
+
"node-name": "{{user `node-name`}}",
|
111
|
+
"versions": {
|
112
|
+
"chef": "{{user `chef_channel`}}-{{user `chef_ver`}}"
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"only": [
|
119
|
+
"azure-arm"
|
120
|
+
],
|
121
|
+
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
|
122
|
+
"inline": [
|
123
|
+
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
|
124
|
+
],
|
125
|
+
"inline_shebang": "/bin/sh -x",
|
126
|
+
"type": "shell",
|
127
|
+
"skip_clean": true
|
105
128
|
}
|
106
|
-
|
107
|
-
|
108
|
-
]
|
109
|
-
}
|
129
|
+
]
|
130
|
+
}
|
@@ -1,98 +1,137 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"builders": [
|
31
|
-
{ "type": "amazon-ebs",
|
32
|
-
"access_key": "{{user `aws_access_key`}}",
|
33
|
-
"secret_key": "{{user `aws_secret_key`}}",
|
34
|
-
"region": "{{user `aws_region`}}",
|
35
|
-
"source_ami": "{{user `aws_source_ami`}}",
|
36
|
-
"instance_type": "m4.large",
|
37
|
-
"communicator": "winrm",
|
38
|
-
"associate_public_ip_address": true,
|
39
|
-
"winrm_port": 5985,
|
40
|
-
"winrm_username": "{{user `winrm_username`}}",
|
41
|
-
"winrm_password": "{{user `winrm_password`}}",
|
42
|
-
"user_data_file": "{{template_dir}}/scripts/bootstrap-aws.txt",
|
43
|
-
"ami_name": "workstation-{{user `workstation-number`}}-{{timestamp}}"
|
2
|
+
"variables": {
|
3
|
+
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
|
4
|
+
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
|
5
|
+
"aws_region": "{{env `AWS_REGION`}}",
|
6
|
+
"aws_source_ami": "ami-87c037e7",
|
7
|
+
"azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
|
8
|
+
"azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
|
9
|
+
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
|
10
|
+
"azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
|
11
|
+
"azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
|
12
|
+
"azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
|
13
|
+
"azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
|
14
|
+
"azure_location": "",
|
15
|
+
"gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
|
16
|
+
"gce_project_id": "{{env `GCE_PROJECT_ID`}}",
|
17
|
+
"gce_zone": "{{env `GCE_ZONE`}}",
|
18
|
+
"gce_source_image": "windows-server-2012-r2-dc-v20160809",
|
19
|
+
"build-nodes": "1",
|
20
|
+
"chefdk": "stable-latest",
|
21
|
+
"domain_prefix": "",
|
22
|
+
"domain": "animals.biz",
|
23
|
+
"enterprise": "mammals",
|
24
|
+
"org": "marsupials",
|
25
|
+
"ssh_username": "ubuntu",
|
26
|
+
"winrm_password": "RL9@T40BTmXh",
|
27
|
+
"winrm_username": "Administrator",
|
28
|
+
"workstation-number": "1",
|
29
|
+
"workstations": "1"
|
44
30
|
},
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
"
|
93
|
-
|
31
|
+
"builders": [
|
32
|
+
{
|
33
|
+
"type": "amazon-ebs",
|
34
|
+
"access_key": "{{user `aws_access_key`}}",
|
35
|
+
"secret_key": "{{user `aws_secret_key`}}",
|
36
|
+
"region": "{{user `aws_region`}}",
|
37
|
+
"source_ami": "{{user `aws_source_ami`}}",
|
38
|
+
"instance_type": "m4.large",
|
39
|
+
"communicator": "winrm",
|
40
|
+
"associate_public_ip_address": true,
|
41
|
+
"winrm_port": 5985,
|
42
|
+
"winrm_username": "{{user `winrm_username`}}",
|
43
|
+
"winrm_password": "{{user `winrm_password`}}",
|
44
|
+
"user_data_file": "{{template_dir}}/scripts/bootstrap-aws.txt",
|
45
|
+
"ami_name": "workstation-{{user `workstation-number`}}-{{timestamp}}"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"type": "azure-arm",
|
49
|
+
"subscription_id": "{{user `azure_subscription_id`}}",
|
50
|
+
"client_id": "{{user `azure_client_id`}}",
|
51
|
+
"client_secret": "{{user `azure_client_secret`}}",
|
52
|
+
"tenant_id": "{{user `azure_tenant_id`}}",
|
53
|
+
"resource_group_name": "{{user `azure_resource_group`}}",
|
54
|
+
"storage_account": "{{user `azure_storage_account`}}",
|
55
|
+
"object_id": "{{user `azure_object_id`}}",
|
56
|
+
"capture_container_name": "images",
|
57
|
+
"capture_name_prefix": "workstation-{{user `workstation-number`}}-{{timestamp}}",
|
58
|
+
"os_type": "Windows",
|
59
|
+
"image_publisher": "MicrosoftWindowsServer",
|
60
|
+
"image_offer": "WindowsServer",
|
61
|
+
"image_sku": "2012-R2-Datacenter",
|
62
|
+
"location": "{{user `azure_location`}}",
|
63
|
+
"vm_size": "Standard_DS3_v2",
|
64
|
+
"communicator": "winrm",
|
65
|
+
"winrm_username": "packer",
|
66
|
+
"winrm_use_ssl": "true",
|
67
|
+
"winrm_insecure": "true",
|
68
|
+
"winrm_port": 5986,
|
69
|
+
"winrm_timeout": "5m"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"type": "googlecompute",
|
73
|
+
"account_file": "{{user `gce_account_file`}}",
|
74
|
+
"project_id": "{{user `gce_project_id`}}",
|
75
|
+
"source_image": "{{user `gce_source_image`}}",
|
76
|
+
"zone": "{{user `gce_zone`}}",
|
77
|
+
"disk_type": "pd-ssd",
|
78
|
+
"disk_size": "80",
|
79
|
+
"machine_type": "n1-highcpu-8",
|
80
|
+
"image_name": "workstation-{{user `workstation-number`}}-{{timestamp}}",
|
81
|
+
"communicator": "winrm",
|
82
|
+
"winrm_port": 5985,
|
83
|
+
"winrm_username": "{{user `winrm_username`}}",
|
84
|
+
"winrm_password": "{{user `winrm_password`}}",
|
85
|
+
"metadata": {
|
86
|
+
"windows-startup-script-url": "gs://wombat-bootstrap/win-bootstrap.ps1"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"provisioners": [
|
91
|
+
{
|
92
|
+
"type": "file",
|
93
|
+
"source": "{{pwd}}/keys/",
|
94
|
+
"destination": "C:\\Windows\\Temp"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"type": "file",
|
98
|
+
"source": "{{pwd}}/files/",
|
99
|
+
"destination": "C:\\Windows\\Temp"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"type": "chef-solo",
|
103
|
+
"install_command": "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel {{user `chef_channel`}} -version {{user `chef_ver`}}\"",
|
104
|
+
"guest_os_type": "windows",
|
105
|
+
"cookbook_paths": [
|
106
|
+
"{{pwd}}/vendored-cookbooks/workstation"
|
107
|
+
],
|
108
|
+
"run_list": [
|
109
|
+
"workstation",
|
110
|
+
"wombat::etc-hosts"
|
111
|
+
],
|
112
|
+
"json": {
|
113
|
+
"demo": {
|
114
|
+
"admin-user": "{{user `ssh_username`}}",
|
115
|
+
"domain_prefix": "{{user `domain_prefix`}}",
|
116
|
+
"domain": "{{user `domain`}}",
|
117
|
+
"enterprise": "{{user `enterprise`}}",
|
118
|
+
"org": "{{user `org`}}",
|
119
|
+
"workstation-number": "{{user `workstation-number`}}",
|
120
|
+
"build-nodes": "{{user `build-nodes`}}",
|
121
|
+
"versions": {
|
122
|
+
"chefdk": "{{user `chefdk`}}"
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"only": [
|
129
|
+
"azure-arm"
|
130
|
+
],
|
131
|
+
"type": "windows-shell",
|
132
|
+
"inline": [
|
133
|
+
"C:\\Windows\\System32\\sysprep\\sysprep.exe /quiet /generalize /oobe /shutdown"
|
134
|
+
]
|
94
135
|
}
|
95
|
-
|
96
|
-
|
97
|
-
]
|
98
|
-
}
|
136
|
+
]
|
137
|
+
}
|