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,116 +1,138 @@
|
|
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
|
-
|
31
|
-
"builders": [
|
32
|
-
{ "type": "amazon-ebs",
|
33
|
-
"access_key": "{{user `aws_access_key`}}",
|
34
|
-
"secret_key": "{{user `aws_secret_key`}}",
|
35
|
-
"region": "{{user `aws_region`}}",
|
36
|
-
"source_ami": "{{user `aws_source_ami`}}",
|
37
|
-
"instance_type": "t2.micro",
|
38
|
-
"communicator": "ssh",
|
39
|
-
"associate_public_ip_address": true,
|
40
|
-
"ssh_private_ip": false,
|
41
|
-
"ssh_username": "{{user `ssh_username`}}",
|
42
|
-
"ssh_pty" : true,
|
43
|
-
"ami_name": "build-node-{{user `node-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-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
|
+
"chefdk": "stable-latest",
|
24
|
+
"domain": "animals.biz",
|
25
|
+
"domain_prefix": "",
|
26
|
+
"enterprise": "mammals",
|
27
|
+
"node-number": "1",
|
28
|
+
"org": "marsupials",
|
29
|
+
"ssh_username": "ubuntu",
|
30
|
+
"workstations": "1"
|
44
31
|
},
|
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
|
-
|
105
|
-
|
32
|
+
"builders": [
|
33
|
+
{
|
34
|
+
"type": "amazon-ebs",
|
35
|
+
"access_key": "{{user `aws_access_key`}}",
|
36
|
+
"secret_key": "{{user `aws_secret_key`}}",
|
37
|
+
"region": "{{user `aws_region`}}",
|
38
|
+
"source_ami": "{{user `aws_source_ami`}}",
|
39
|
+
"instance_type": "t2.micro",
|
40
|
+
"communicator": "ssh",
|
41
|
+
"associate_public_ip_address": true,
|
42
|
+
"ssh_private_ip": false,
|
43
|
+
"ssh_username": "{{user `ssh_username`}}",
|
44
|
+
"ssh_pty": true,
|
45
|
+
"ami_name": "build-node-{{user `node-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": "build-node",
|
58
|
+
"os_type": "Linux",
|
59
|
+
"image_publisher": "Canonical",
|
60
|
+
"image_offer": "UbuntuServer",
|
61
|
+
"image_sku": "14.04.5-LTS",
|
62
|
+
"location": "{{user `azure_location`}}",
|
63
|
+
"vm_size": "Standard_DS3_v2",
|
64
|
+
"ssh_username": "{{user `ssh_username`}}",
|
65
|
+
"ssh_pty": true
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"type": "googlecompute",
|
69
|
+
"account_file": "{{user `gce_account_file`}}",
|
70
|
+
"project_id": "{{user `gce_project_id`}}",
|
71
|
+
"source_image": "{{user `gce_source_image`}}",
|
72
|
+
"zone": "{{user `gce_zone`}}",
|
73
|
+
"disk_type": "pd-ssd",
|
74
|
+
"disk_size": "80",
|
75
|
+
"image_name": "build-node-{{user `node-number`}}-{{timestamp}}",
|
76
|
+
"machine_type": "n1-standard-2",
|
77
|
+
"ssh_username": "{{user `ssh_username`}}",
|
78
|
+
"ssh_pty": true
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"provisioners": [
|
82
|
+
{
|
83
|
+
"type": "file",
|
84
|
+
"source": "{{pwd}}/files/",
|
85
|
+
"destination": "/tmp"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"type": "file",
|
89
|
+
"source": "{{pwd}}/keys/",
|
90
|
+
"destination": "/tmp"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"type": "chef-solo",
|
94
|
+
"install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
|
95
|
+
"cookbook_paths": [
|
96
|
+
"{{pwd}}/vendored-cookbooks/build_node"
|
97
|
+
],
|
98
|
+
"run_list": [
|
99
|
+
"build_node",
|
100
|
+
"wombat::authorized-keys",
|
101
|
+
"wombat::etc-hosts"
|
102
|
+
],
|
103
|
+
"json": {
|
104
|
+
"demo": {
|
105
|
+
"admin-user": "{{user `ssh_username`}}",
|
106
|
+
"domain_prefix": "{{user `domain_prefix`}}",
|
107
|
+
"domain": "{{user `domain`}}",
|
108
|
+
"enterprise": "{{user `enterprise`}}",
|
109
|
+
"org": "{{user `org`}}",
|
110
|
+
"node-number": "{{user `node-number`}}",
|
111
|
+
"build-nodes": "{{user `build-nodes`}}",
|
112
|
+
"workstations": "{{user `workstations`}}",
|
113
|
+
"versions": {
|
114
|
+
"chefdk": "{{user `chefdk`}}"
|
115
|
+
}
|
116
|
+
},
|
117
|
+
"delivery_build": {
|
118
|
+
"trusted_certs": {
|
119
|
+
"chef-server": "/tmp/chef.crt",
|
120
|
+
"delivery": "/tmp/automate.crt"
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
106
124
|
},
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
125
|
+
{
|
126
|
+
"only": [
|
127
|
+
"azure-arm"
|
128
|
+
],
|
129
|
+
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
|
130
|
+
"inline": [
|
131
|
+
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
|
132
|
+
],
|
133
|
+
"inline_shebang": "/bin/sh -x",
|
134
|
+
"type": "shell",
|
135
|
+
"skip_clean": true
|
112
136
|
}
|
113
|
-
|
114
|
-
|
115
|
-
]
|
116
|
-
}
|
137
|
+
]
|
138
|
+
}
|
@@ -1,111 +1,133 @@
|
|
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
|
-
|
31
|
-
|
32
|
-
"builders": [
|
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": "ssh",
|
40
|
-
"associate_public_ip_address": true,
|
41
|
-
"ssh_username": "{{user `ssh_username`}}",
|
42
|
-
"ssh_pty" : true,
|
43
|
-
"ami_name": "chef-{{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
|
+
"chef-server": "stable-latest",
|
24
|
+
"domain": "animals.biz",
|
25
|
+
"domain_prefix": "",
|
26
|
+
"enterprise": "mammals",
|
27
|
+
"manage": "stable-latest",
|
28
|
+
"org": "marsupials",
|
29
|
+
"push-jobs-server": "stable-latest",
|
30
|
+
"ssh_username": "ubuntu",
|
31
|
+
"workstations": "1"
|
44
32
|
},
|
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
|
-
|
105
|
-
"
|
106
|
-
|
33
|
+
"builders": [
|
34
|
+
{
|
35
|
+
"type": "amazon-ebs",
|
36
|
+
"access_key": "{{user `aws_access_key`}}",
|
37
|
+
"secret_key": "{{user `aws_secret_key`}}",
|
38
|
+
"region": "{{user `aws_region`}}",
|
39
|
+
"source_ami": "{{user `aws_source_ami`}}",
|
40
|
+
"instance_type": "m4.large",
|
41
|
+
"communicator": "ssh",
|
42
|
+
"associate_public_ip_address": true,
|
43
|
+
"ssh_username": "{{user `ssh_username`}}",
|
44
|
+
"ssh_pty": true,
|
45
|
+
"ami_name": "chef-{{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": "chef-server",
|
58
|
+
"os_type": "Linux",
|
59
|
+
"image_publisher": "Canonical",
|
60
|
+
"image_offer": "UbuntuServer",
|
61
|
+
"image_sku": "14.04.5-LTS",
|
62
|
+
"location": "{{user `azure_location`}}",
|
63
|
+
"vm_size": "Standard_DS3_v2",
|
64
|
+
"ssh_username": "{{user `ssh_username`}}",
|
65
|
+
"ssh_pty": true
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"type": "googlecompute",
|
69
|
+
"account_file": "{{user `gce_account_file`}}",
|
70
|
+
"project_id": "{{user `gce_project_id`}}",
|
71
|
+
"source_image": "{{user `gce_source_image`}}",
|
72
|
+
"zone": "{{user `gce_zone`}}",
|
73
|
+
"disk_type": "pd-ssd",
|
74
|
+
"disk_size": "80",
|
75
|
+
"image_name": "chef-{{timestamp}}",
|
76
|
+
"machine_type": "n1-standard-2",
|
77
|
+
"ssh_username": "{{user `ssh_username`}}",
|
78
|
+
"ssh_pty": true
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"provisioners": [
|
82
|
+
{
|
83
|
+
"type": "file",
|
84
|
+
"source": "{{pwd}}/files/",
|
85
|
+
"destination": "/tmp"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"type": "file",
|
89
|
+
"source": "{{pwd}}/keys/",
|
90
|
+
"destination": "/tmp"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"type": "chef-solo",
|
94
|
+
"install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
|
95
|
+
"cookbook_paths": [
|
96
|
+
"{{pwd}}/vendored-cookbooks/chef_server"
|
97
|
+
],
|
98
|
+
"run_list": [
|
99
|
+
"chef_server",
|
100
|
+
"wombat::authorized-keys",
|
101
|
+
"wombat::etc-hosts"
|
102
|
+
],
|
103
|
+
"json": {
|
104
|
+
"demo": {
|
105
|
+
"admin-user": "{{user `ssh_username`}}",
|
106
|
+
"domain_prefix": "{{user `domain_prefix`}}",
|
107
|
+
"domain": "{{user `domain`}}",
|
108
|
+
"enterprise": "{{user `enterprise`}}",
|
109
|
+
"org": "{{user `org`}}",
|
110
|
+
"build-nodes": "{{user `build-nodes`}}",
|
111
|
+
"workstations": "{{user `workstations`}}",
|
112
|
+
"versions": {
|
113
|
+
"chef-server": "{{user `chef-server`}}",
|
114
|
+
"push-jobs-server": "{{user `push-jobs-server`}}",
|
115
|
+
"manage": "{{user `manage`}}"
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"only": [
|
122
|
+
"azure-arm"
|
123
|
+
],
|
124
|
+
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
|
125
|
+
"inline": [
|
126
|
+
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
|
127
|
+
],
|
128
|
+
"inline_shebang": "/bin/sh -x",
|
129
|
+
"type": "shell",
|
130
|
+
"skip_clean": true
|
107
131
|
}
|
108
|
-
|
109
|
-
|
110
|
-
]
|
111
|
-
}
|
132
|
+
]
|
133
|
+
}
|