summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-cluster/build_ami.yml
blob: 5bf4f652a5ced159b5a3185743ad642c5232bbb0 (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
---
- 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') }}"

- import_playbook: 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(ansible_ssh_user) }}"
      openshift_node_bootstrap: True
      openshift_node_image_prep_packages:
      - cloud-utils-growpart

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

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