summaryrefslogtreecommitdiff
path: root/baserock_openid_provider/packer_template.json
blob: 0de9bc842eb2aab403634c3ba79d75837b69b57e (plain)
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
33
34
35
36
37
38
39
40
41
42
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
{
    "builders": [
        {
            "name": "development",
            "type": "docker",
            "image": "fedora:20",
            "commit": true,
            "run_command": ["-d", "-i", "-t", "{{.Image}}", "/bin/sh"]
        },
        {
            "name": "production",
            "type": "openstack",
            "image_name": "baserock_openid_provider",
            "flavor": "f0577618-9125-4948-b450-474e225bbc4c",
            "source_image": "742e0414-c985-4994-b307-4aafade942b3",
            "networks": ["d079fa3e-2558-4bcb-ad5a-279040c202b5"],
            "floating_ip": "185.43.218.169",
            "use_floating_ip": true,
            "ssh_username": "fedora"
        }
    ],
    "provisioners": [
        {
            "type": "shell",
            "inline": [
               "sudo chown fedora:fedora /srv"
            ],
            "only": ["production"]
        },
        {
            "type": "file",
            "source": "baserock_openid_provider",
            "destination": "/srv",
            "only": ["production"]
        },
        {
            "type": "shell",
            "inline": [ "sudo yum install -y ansible"]
        },
        {
            "type": "ansible-local",
            "playbook_file": "baserock_openid_provider/image-config.yml",
            "command": "sudo ansible-playbook"
        },
        {
            "type": "shell",
            "inline": [
                "ln -s /srv/test-baserock-infrastructure/baserock_openid_provider /srv"
            ],
            "only": ["development"]
        },
        {
            "type": "shell",
            "inline": [
                "sudo yum install -y libselinux-python",
                "sudo ansible localhost -m selinux -a state=disabled",
                "sudo setenforce 0"
            ],
            "only": ["production"]
        },
        {
            "type": "shell",
            "inline": [ "sync; sync; sleep 10; sync" ],
            "only": ["production"]
        }
    ],
    "post-processors": [
        [
            {
                "type": "docker-tag",
                "repository": "baserock/openid-provider",
                "tag": "latest",
                "only": ["development"]
            }
        ]
    ]
}