56
RHUG NJ July 2017 Button Push Deployments With Integrated Red Hat Open Management The power of automation Laurent Domb Principal Cloud Solutions Architect

Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RHUG NJ July 2017Button Push Deployments With Integrated Red Hat Open ManagementThe power of automation

Laurent DombPrincipal Cloud Solutions Architect

Page 2: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

About Me

Laurent Domb

Principal Cloud Solutions Architect

[email protected]

RHCA VI

Red Hat

Page 3: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

One Button Push Away From Red Hat Management

Page 4: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedFrom start to finish in less than 3 hours with these ingredients

Satellite 6

CloudForms Insights

Ansible Tower

Page 5: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedPrerequisites

● https://github.com/ldomb/rhsummit2017 ● Minimum requirement ansible 2.2.1● Ansible vault file with your passwords, private keys ...● Ansible Tower License can be requested here:

○ https://www.ansible.com/license● Satellite 6 Manifest ● An AWS account (AWS Cli )● Private key for AWS instances● CloudForms image in AWS ( uploadcfme.yaml )

Page 6: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible VaultThe Power of Ansible

---#### THIS IS A DEMO VAULT FILE AND IS USUALLY ENCRYPTED #############################vault_ec2_keypair: "YOURKEYPAIR"vault_ec2_security_group: "YOURSECURITYGROUP"vault_ec2_subnet_ids: ['YOURSUBNETID']vault_ec2_access: ACCESSKEYvault_ec2_secret: AWSSECRETvault_tower_pass: RedhatIsCoolvault_sat6_pass: RedhatIsCoolvault_cfme_pass: RedhatIsCoolvault_gitlab_pass: pushthelinimitvault_rhn_pass: pushthelinimit

https://raw.githubusercontent.com/ldomb/rhsummit2017/master/group_vars/all/vault

Page 7: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedFrom start to finish in less than 3 hours with these ingredients

summit2017$ ansible-playbook buildrhmgmt.yaml --private-key=ldomb.pem --vault-password-file=../vaultpass -vv

Page 8: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT COREOne click to rule them all - Foundation Installation Flow

Ansible Core

Page 9: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT ANSIBLE TOWEROne click to rule them all - Foundation Installation Flow

Ansible Core

Page 10: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

SCHEDULINGSchedule automation Jobs

AUDITINGSee a full Ansible job history with drill-in details

ACCESS CONTROLRole-based access control & LDAP integration

DELEGATION OF CREDENTIALSDelegate credentials without giving away secrets

INVENTORY MANAGEMENTGraphically manage your internal & cloud resources

PUSH-BUTTON LAUNCHLaunch automation jobs with a button

API & CLIDocumented RESTful API and Tower CLI to integrate Tower into your tools

ANSIBLE TOWER

Page 11: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT TOOLSOne click to rule them all - Foundation Installation Flow

Page 12: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible Hostvars and add_hostThe Power of Ansible

- add_host: name={{ item.public_ip }} > groups=tag_Type_{{ec2_tag_Type}},tag_Environment_{{ec2_tag_Environment}} ec2_tag_Name={{ec2_tag_Name}} ec2_region={{ec2_region}} ec2_tag_Type={{ec2_tag_Type}} ec2_tag_Environment={{ec2_tag_Environment}} ec2_ip_address={{item.public_ip}} with_items: "{{ ec2.instances }}"

Page 13: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible Regex and SubstitutionsThe Power of Ansible

- name: replace /tmp/ansible-tower-setup-bundle-{{ tower_version }}.el7/roles/nginx/tasks/tasks.yml replace: dest: /tmp/ansible-tower-setup-bundle-{{ tower_version }}.el7/roles/nginx/tasks/tasks.yml regexp: 'www.ansible.com' replace: "{{ ansible_nodename }}"

- name: add /etc/tower path to setting.py lineinfile: dest: /tmp/ansible-tower-setup-bundle-{{ tower_version }}.el7/roles/awx_install/templates/settings.py.j2 line: "AWX_PROOT_SHOW_PATHS = ['/etc/tower/']"

Page 14: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible URI Rest InteractionThe Power of Ansible

- name: add license uri: url: https://{{inventory_hostname}}/api/v1/config/ method: POST validate_certs: no user: admin password: "{{ tower_pass }}" status_code: 200 body: "{{ tower_lic }}" body_format: json

Page 15: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedBuilding Ansible Tower - Gains

Page 16: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedBuilding Ansible Tower - Gains - Workflow Editor

Ansible Tower orchestrates your infrastructure in a secure fashion

Page 17: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT SATELLITE 6 / CLOUDFORMSOne click to rule them all - Foundation Installation Flow

Ansible Core

Job 2

Job 1

Page 18: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

What Is CloudForms?CloudForms - Overview

Page 19: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - Overview

● Manage ansible git projects● Store credentials for some providers● Execute a playbook from a service catalog● Execute a playbooks via Rest API● Execute a playbook from an alert● Execute a playbook from a control policy● Execute a playbook through automation

Page 20: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 21: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 22: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 23: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 24: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 25: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

CloudForms Ansible Automation InsideCloudForms - gains

Page 26: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT TOOLSOne click to rule them all - Foundation Installation Flow

Job

1

Page 27: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible Hostvars and wait_forThe Power of Ansible

- name: add tower to /etc/hosts on cfme lineinfile: dest: /etc/hosts line: "{{ hostvars[groups['tag_Name_' + tower_tag_Name][0]]['ec2_private_ip_address'] }} {{ hostvars[groups['tag_Name_' + tower_tag_Name][0]]['ec2_private_dns_name'] }} tower"

- name: wait for cfme ui wait_for: host: {{ inventory_hostname }} port: 443 timeout: 600

Page 28: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible delegate_toThe Power of Ansible

- name: get cert command: cat /etc/tower/tower.cert register: towercert delegate_to: "localhost" become: false

- name: towercrt lineinfile: dest: /etc/pki/ca-trust/source/anchors/tower.crt line: "{{ towercert.stdout }}" create: yes

- name: update certs shell: update-ca-trust

Page 29: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible manageiq_providerThe Power of Ansible

- name: Add Amazon EC2 Provider to ManageIQ manageiq_provider: name: 'AWS01' provider_type: 'amazon' state: 'present' provider_region: 'us-east-1' access_key_id: "{{ ec2_access }}" secret_access_key: "{{ ec2_secret }}" miq_url: 'https://{{ inventory_hostname }}' miq_username: 'admin' miq_password: "{{ cfme_pass }}" miq_verify_ssl: false become: false delegate_to: localhost register: result

Page 30: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT CLOUDFORMSOne click to rule them all - Foundation Installation Flow

Ansible Core

Page 31: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedCloudForms - Ansible Tower integration gains

Page 32: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedCloudForms - Ansible Tower integration gains

Page 33: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedCloudForms - Ansible Tower integration gains

Page 34: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedCloudForms - Ansible Tower integration gains

Page 35: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedCloudForms - Ansible Tower integration gains

CloudForms + Ansible Tower = Build anything anywhere, any time

Page 36: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT SATELLITE 6 / CLOUDFORMSOne click to rule them all - Foundation Installation Flow

Ansible Core

Job 2

Job 1

Page 37: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT TOOLSOne click to rule them all - Foundation Installation Flow

Job

2

Page 38: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Ansible register and delegate_toThe Power of Ansible

- name: get sat6 cert command: cat /root/ssl-build/katello-server-ca.crt register: sat6cert

- name: sat6cert lineinfile: dest: /etc/pki/ca-trust/source/anchors/sat6.crt line: "{{ sat6cert.stdout }}" create: yes delegate_to: "{{ cloudformsip }}"

- name: update certs shell: update-ca-trust delegate_to: "{{ cloudformsip }}"

Page 39: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT SATELLITE 6One click to rule them all - Foundation Installation Flow

Ansible Core

Page 40: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedSatellite 6 - CloudForms - Ansible Tower - Integration Gains

Page 41: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedSatellite 6 - CloudForms - Ansible Tower - Integration Gains

Page 42: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedSatellite 6 - CloudForms - Ansible Tower - Integration Gains

Page 43: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedSatellite 6 - CloudForms - Ansible Tower - Integration Gains

Sate

llite

6

Clo

udFo

rms

Page 44: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedSatellite 6 - CloudForms - Ansible Tower - Integration Gains

CloudForms + Ansible Tower + Satellite = Build anything anywhere anytime and make it secure!

Sate

llite

6C

loud

Form

s

Page 45: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT INSIGHTSOne click to rule them all - Foundation Installation Flow

Ansible Core

Page 46: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT INSIGHTSOne click to rule them all - Foundation Installation Flow

Ansible Core

Page 47: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT INSIGHTSOne click to rule them all - Foundation Installation Flow

Ansible Core

Page 48: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedInsights - CloudForms - Ansible Tower - Satellite 6 - integration gains

Page 49: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedInsights - CloudForms - Ansible Tower - Satellite 6 - integration gains

Page 50: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedInsights - CloudForms - Ansible Tower - Satellite 6 - integration gains

Page 51: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

Red Hat Management AutomatedInsights - CloudForms - Ansible Tower - Satellite 6 - integration gains

CloudForms + Ansible Tower + Satellite + Insights = Build anything, anywhere, anytime, make it secure and keep a piece of mind that you’ve done it right

Page 52: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

RH-MANAGEMENT SUPERPOWERS TEAM

SATELLITE 6 INSIGHTS CLOUDFORMSANSIBLE TOWER

Provision and manage servers and networking anywhere, anytime and be sure it's secure and compliant. Keep in mind we are watching you!

Page 53: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

One Button Push To RH Management Suite

https://goo.gl/JY7hoa

Page 54: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

THANK YOUplus.google.com/+RedHat

linkedin.com/company/red-hat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNews

Page 55: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP
Page 56: Integrated Red Hat Open Management Button Push Deployments …blog.domb.net/wp-content/uploads/RHUG-Button-Push... · 2017. 7. 12. · ACCESS CONTROL Role-based access control & LDAP

ResourcesLinks to resources used in this presentation

Resources used for this presentation

● https://access.redhat.com/articles/2258471 (hammer cheat sheet)● https://github.com/rhtconsulting/cfme-rhconsulting-scripts ● https://galaxy.ansible.com/juliovp01/satellite6-install/ (original playbook for sat6)