Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable IAM roles for EC2s in AWS #10224

Merged
merged 1 commit into from Sep 25, 2018

Conversation

mazzystr
Copy link
Contributor

@mazzystr mazzystr commented Sep 25, 2018

Enable IAM roles for EC2s in AWS. Iam roles are now created during prerequisites play. Build_node_group moved away iam role creation to iam role query. Ec2 and Auto Scale Group instance_profile keys updated to suit.

  • Set openshift_aws_create_iam_role: True
  • Update openshift_aws_master_instance_config, openshift_aws_node_group_config, openshift_aws_launch_config_iam_roles as needed.
  • Execute the following plays...
ansible-playbook -i hosts openshift-cluster/prerequisites.yml -e @provisioning_vars.yml
ansible-playbook -i hosts openshift-cluster/provision_install.yml -e @provisioning_vars.yml

Resolves Bugzilla 1630319 and 1632843

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 25, 2018
@mazzystr
Copy link
Contributor Author

Prerequisites

PLAY [Create iam role] ******************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************
ok: [localhost]

TASK [include_role : openshift_aws] *****************************************************************************************************

TASK [openshift_aws : Create an iam role] ***********************************************************************************************
changed: [localhost] => (item=master)
changed: [localhost] => (item=compute)
changed: [localhost] => (item=infra)

TASK [openshift_aws : create an iam policy] *********************************************************************************************
changed: [localhost] => (item=master)
changed: [localhost] => (item=compute)
changed: [localhost] => (item=infra)

Provision_install (masters)

.....
TASK [openshift_aws : fetch the iam role] ***********************************************************************************************
ok: [localhost]

TASK [openshift_aws : create instance(s)] ***********************************************************************************************
changed: [localhost] => (item=subnet-090cc29c98a4208dd)
.....

Provision_install (compute)

.....
TASK [openshift_aws : fetch the iam role] ***********************************************************************************************
ok: [localhost]

TASK [openshift_aws : Set scale group instances autonaming] *****************************************************************************
skipping: [localhost]

TASK [openshift_aws : include_tasks] ****************************************************************************************************
included: /home/ccallega/git/openshift-ansible/roles/openshift_aws/tasks/launch_config.yml for localhost

TASK [openshift_aws : fetch the security groups for launch config] **********************************************************************
ok: [localhost]

TASK [openshift_aws : fail] *************************************************************************************************************
skipping: [localhost]

TASK [openshift_aws : Create the node scale group launch config] ************************************************************************
changed: [localhost]
.....

Provision_install (infra)

.....
TASK [openshift_aws : fetch the iam role] ***********************************************************************************************
ok: [localhost]

TASK [openshift_aws : Set scale group instances autonaming] *****************************************************************************
skipping: [localhost]

TASK [openshift_aws : include_tasks] ****************************************************************************************************
included: /home/ccallega/git/openshift-ansible/roles/openshift_aws/tasks/launch_config.yml for localhost

TASK [openshift_aws : fetch the security groups for launch config] **********************************************************************
ok: [localhost]

TASK [openshift_aws : fail] *************************************************************************************************************
skipping: [localhost]

TASK [openshift_aws : Create the node scale group launch config] ************************************************************************
changed: [localhost]
.....

iam_role: "{{ openshift_aws_iam_master_role_name | default(openshift_aws_iam_role_name) }}"
policy_name: "{{ openshift_aws_iam_master_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
policy_json: "{{ openshift_aws_iam_master_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
iam_role: "{{ openshift_aws_launch_config_iam_roles['master'].name | default(openshift_aws_iam_role_name) }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove default from these.

@@ -333,6 +327,20 @@ openshift_aws_launch_config_security_groups:
- "{{ openshift_aws_clusterid }}_infra" # node type sg
- "{{ openshift_aws_clusterid }}_infra_k8s" # node type sg k8s

openshift_aws_launch_config_iam_roles:
master:
name: "{{ openshift_aws_clusterid }}-iam_master"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: "{{ openshift_aws_iam_master_role_name | default(openshift_aws_clusterid ~ '-iam_master') }}"

Do this for the others as well.

Copy link
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 25, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mazzystr, michaelgugino

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 25, 2018
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit ca962ff into openshift:master Sep 25, 2018
@mwoodson
Copy link
Contributor

/cherrypick release-3.11

1 similar comment
@sdodson
Copy link
Member

sdodson commented Oct 22, 2018

/cherrypick release-3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants