add packer files
authorLorin Hochstein <lhochstein@netflix.com>
Sun, 12 Feb 2017 21:41:38 +0000 (13:41 -0800)
committerLorin Hochstein <lhochstein@netflix.com>
Sun, 12 Feb 2017 21:41:38 +0000 (13:41 -0800)
ch12/playbooks/web-ami.yml [new file with mode: 0644]
ch12/playbooks/web.json [new file with mode: 0644]

diff --git a/ch12/playbooks/web-ami.yml b/ch12/playbooks/web-ami.yml
new file mode 100644 (file)
index 0000000..53d0af5
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: configure a webserver as an ami
+  hosts: localhost
+  become: True
+  roles:
+    - web
diff --git a/ch12/playbooks/web.json b/ch12/playbooks/web.json
new file mode 100644 (file)
index 0000000..a3ecc64
--- /dev/null
@@ -0,0 +1,29 @@
+{
+  "builders": [
+    {
+      "type": "amazon-ebs",
+      "region": "us-west-1",
+      "source_ami": "ami-79df8219",
+      "instance_type": "t2.micro",
+      "ssh_username": "ubuntu",
+      "ami_name": "web-nginx-{{timestamp}}",
+      "tags": {
+        "Name": "web-nginx"
+      }
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "shell",
+      "inline": [
+        "sleep 30",
+        "sudo apt-get update",
+        "sudo apt-get install -y python-minimal"
+      ]
+    },
+    {
+      "type": "ansible",
+      "playbook_file": "web-ami.yml"
+    }
+  ]
+}