summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-cluster/build_ami.yml
blob: 559a37cbe5c8bcd61982753290f5e67d40a4335f (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
---
- hosts: localhost
  connection: local
  gather_facts: no
  tasks:
  - name: Require openshift_aws_base_ami
    fail:
      msg: "A base AMI is required for AMI building.  Please ensure  `openshift_aws_base_ami` is defined."
    when: openshift_aws_base_ami is undefined

  - name: "Alert user to variables needed and their values - {{ item.name }}"
    debug:
      msg: "{{ item.msg }}"
    with_items:
    - name: openshift_aws_clusterid
      msg: "openshift_aws_clusterid={{ openshift_aws_clusterid | default('default') }}"
    - name: openshift_aws_region
      msg: "openshift_aws_region={{ openshift_aws_region | default('us-east-1') }}"

- include: provision_instance.yml
  vars:
    openshift_aws_node_group_type: compute

- hosts: nodes
  gather_facts: False
  tasks:
  - name: set the user to perform installation
    set_fact:
      ansible_ssh_user: "{{ openshift_aws_build_ami_ssh_user | default('root') }}"

# This is the part that installs all of the software and configs for the instance
# to become a node.
- include: ../../common/openshift-node/image_prep.yml

- include: seal_ami.yml
  vars:
    openshift_aws_ami_name: "openshift-gi-{{ lookup('pipe', 'date +%Y%m%d%H%M')}}"