SlideShare a Scribd company logo
Kok Hui Lew
Specialist Solution Architect
Automate Windows Environments
with Ansible and DSC
Agenda
● Windows Management with Ansible
● What is DSC?
● Why use DSC with Ansible?
● Where to use Ansible Windows Modules vs DSC
resources?
● Compare and contrast Windows Modules and
DSC resource examples
● Credential Management
● Example Playbooks
SIMPLE POWERFUL AGENTLESS
App deployment
Configuration management
Workflow orchestration
Network automation
Orchestrate the app lifecycle
Human readable automation
No special coding skills needed
Tasks executed in order
Usable by every team
Get productive quickly
Agentless architecture
Uses OpenSSH & WinRM
No agents to exploit or update
Get started immediately
More efficient & more secure
WHY ANSIBLE?
70+
Windows Modules
Use Ansible to deploy and manage Windows
systems and applications.
ANSIBLE WINDOWS AUTOMATION
ansible.com/windows
350+
Powershell DSC
resources
- hosts: new_servers
tasks:
- name: ensure common OS updates are current
win_updates:
register: update_result
- name: ensure domain membership
win_domain_membership:
dns_domain_name: contoso.corp
domain_admin_user: '{{ domain_admin_username }}'
domain_admin_password: '{{ domain_admin_password }}'
state: domain
register: domain_result
- name: reboot and wait for host if updates or domain change require it
win_reboot:
when: update_result.reboot_required or domain_result.reboot_required
- name: ensure local admin account exists
win_user:
name: localadmin
password: '{{ local_admin_password }}'
groups: Administrators
- name: ensure common tools are installed
win_chocolatey:
name: '{{ item }}'
with_items: ['sysinternals', 'googlechrome']
PLAYBOOK EXAMPLE: WINDOWS
What is DSC?
> Windows Management Platform built in
● Ships natively with Windows Server 2012
R2 and Windows 8.1 and newer
● Requires PowerShell v4 or greater
> Configuration based declarative model
● Define desired state in configuration
● DSC determines how to execute on target
> Push or Pull Architecture
Why Use DSC with Ansible?
Both declarative &
end-state oriented
Scale using Ansible
lightweight
architecture
Compliment each
other
Rich community
ecosystem for both
Ansible Tower
provides enterprise
capabilities
managing Windows
Extend end-to-end
use cases beyond
Windows
management
Where to use Ansible Windows Modules vs DSC resources?
Reasons for using an Ansible module over a DSC resource:
● The host does not support PowerShell v5.0, or it cannot easily be upgraded
● The DSC resource does not offer a feature present in an Ansible module
● DSC resources have limited check mode support, while some Ansible modules have better checks
● DSC resources do not support diff mode, while some Ansible modules do
● Custom resources require further installation steps to be run on the host beforehand, while
Ansible modules are in built-in to Ansible
Reasons for using a DSC resource over an Ansible module:
● The Ansible module does not support a feature present in a DSC resource
● There is no Ansible module available
- name: Install IIS Web-Server
win_feature:
name: Web-Server
state: present
restart: True
include_sub_features: True
include_management_tools: True
- name: Create IIS site
win_iis_website:
name: Ansible
state: started
physical_path: c:sitesAnsible
- name: Add HTTP webbinding to IIS
win_iis_webbinding:
name: Ansible
protocol: http
port: 8080
ip: '*'
state: present
Example playbooks with Ansible Modules vs DSC resources
- name: Install required DSC module
win_psmodule:
name: xWebAdministration
state: present
- name: Install IIS Web-Server
win_dsc:
resource_name: windowsfeature
name: Web-Server
- name: Create IIS site
win_dsc:
resource_name: xWebsite
Ensure: Present
Name: Ansible
State: Started
PhysicalPath: c:sitesAnsible
BindingInfo:
- Protocol: http
Port: 8080
IPAddress: '*'
- name: Install required DSC module
win_psmodule:
name: xWebAdministration
state: present
- name: Install IIS Web-Server
win_dsc:
resource_name: windowsfeature
name: Web-Server
- name: Create IIS site
win_dsc:
resource_name: xWebsite
Ensure: Present
Name: Ansible
State: Started
PhysicalPath: c:sitesAnsible
BindingInfo:
- Protocol: http
Port: 8080
IPAddress: '*'
Use win_dsc module vs Powershell
# Import the module
Import-DscResource -Module xWebAdministration,
PSDesiredStateConfiguration
Node $NodeName
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = 'Present'
Name = 'Web-Server'
}
xWebsite DefaultSite
{
Ensure = 'Present'
Name = 'Ansible'
State = 'Started'
PhysicalPath = 'c:sitesAnsible'
DependsOn = '[WindowsFeature]IIS'
BindingInfo = MSFT_xWebBindingInformation
{
Protocol = 'http'
Port = '8080'
IPAddress = '*'
}
}
}
Handle Credentials with win_dsc Module
● By default win_dsc module uses SYSTEM account
● You can use PsDscRunAsCredential attribute to run as another user:
- name: use win_dsc with PsDscRunAsCredential to run as a different user
win_dsc:
resource_name: Registry
Ensure: Present
Key: HKEY_CURRENT_USERExampleKey
ValueName: TestValue
ValueData: TestData
PsDscRunAsCredential_username: '{{ ansible_user }}'
PsDscRunAsCredential_password: '{{ ansible_password }}'
no_log: true
Some Example DSC Resources
● Built-in:
○ Archive
○ File
○ Group
○ Package
○ WindowsFeature
○ And more..
● Custom resources provided by Microsoft and the community:
○ Domain Controller
○ IIS Web Site
○ SQL Server Cluster
○ Failover Cluster
○ DNS
○ And many more..
13 CONFIDENTIAL
Beyond Server Management - Rolling Update Example
Your applications and systems are more than
just collections of configurations. They’re a
finely tuned and ordered list of tasks and
processes that result in your working
application.
Ansible can do it all:
• Provisioning
• App Deployment
• Configuration Management
• Multi-tier Orchestration
How to obtain a list of Ansible Windows Modules and DSC Resources
● Ansible Modules:
○ https://docs.ansible.com/ansible/latest/modules/list_of_windows_modules.html
● Built-in DSC Resources:
○ https://docs.microsoft.com/en-us/powershell/dsc/builtinresource
○ Or run this powershell command: Find-DscResource
● DSC Resources on Github:
○ https://github.com/PowerShell/DscResources
● DSC Resources on Powershell Gallery:
○ https://www.powershellgallery.com
THANK YOU

More Related Content

What's hot

IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
Kenny Abdiel Maita
 
Using Puppet with Self Service Provisioning
Using Puppet with Self Service ProvisioningUsing Puppet with Self Service Provisioning
Using Puppet with Self Service Provisioning
Puppet
 
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
VMworld
 
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
VMworld
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
Cisco DevNet
 
VMworld 2013: vCenter Deep Dive
VMworld 2013: vCenter Deep Dive VMworld 2013: vCenter Deep Dive
VMworld 2013: vCenter Deep Dive
VMworld
 
PowerCLI Workshop
PowerCLI WorkshopPowerCLI Workshop
PowerCLI Workshop
Carter Shanklin
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1
Mmik Huang
 
Lateral Movement with PowerShell
Lateral Movement with PowerShellLateral Movement with PowerShell
Lateral Movement with PowerShell
kieranjacobsen
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Amazon Web Services
 
EVO-RAIL 2.0 Overview Deck
EVO-RAIL 2.0 Overview DeckEVO-RAIL 2.0 Overview Deck
EVO-RAIL 2.0 Overview DeckErik Bussink
 
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
WinOps Conf
 
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
Kenny Buntinx
 
VMware Integrated OpenStack 2.0
VMware Integrated OpenStack 2.0VMware Integrated OpenStack 2.0
VMware Integrated OpenStack 2.0Erik Bussink
 
How to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWSHow to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWS
Denis Gundarev
 
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
VMworld
 
IBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDKIBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDK
Paul Withers
 
An Introduction to PowerShell for Security Assessments
An Introduction to PowerShell for Security AssessmentsAn Introduction to PowerShell for Security Assessments
An Introduction to PowerShell for Security AssessmentsEnclaveSecurity
 
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
Scott Sutherland
 

What's hot (20)

IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
 
Using Puppet with Self Service Provisioning
Using Puppet with Self Service ProvisioningUsing Puppet with Self Service Provisioning
Using Puppet with Self Service Provisioning
 
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
VMworld 2013: Part 1: Getting Started with vCenter Orchestrator
 
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
VMworld 2013: Part 2: How to Build a Self-Healing Data Center with vCenter Or...
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
 
VMworld 2013: vCenter Deep Dive
VMworld 2013: vCenter Deep Dive VMworld 2013: vCenter Deep Dive
VMworld 2013: vCenter Deep Dive
 
PowerCLI Workshop
PowerCLI WorkshopPowerCLI Workshop
PowerCLI Workshop
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1
 
Lateral Movement with PowerShell
Lateral Movement with PowerShellLateral Movement with PowerShell
Lateral Movement with PowerShell
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
 
EVO-RAIL 2.0 Overview Deck
EVO-RAIL 2.0 Overview DeckEVO-RAIL 2.0 Overview Deck
EVO-RAIL 2.0 Overview Deck
 
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
 
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
SCUGBE_Lowlands_Unite_2017_Servicing your new Windows workplace like a boss.
 
VMware Integrated OpenStack 2.0
VMware Integrated OpenStack 2.0VMware Integrated OpenStack 2.0
VMware Integrated OpenStack 2.0
 
How to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWSHow to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWS
 
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
VMworld 2013: Keep it Simple and Integrated - Out-of the Box Cross-System Aut...
 
IBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDKIBM Think Session 3249 Watson Work Services Java SDK
IBM Think Session 3249 Watson Work Services Java SDK
 
ebk EVO-RAIL v104
ebk EVO-RAIL v104ebk EVO-RAIL v104
ebk EVO-RAIL v104
 
An Introduction to PowerShell for Security Assessments
An Introduction to PowerShell for Security AssessmentsAn Introduction to PowerShell for Security Assessments
An Introduction to PowerShell for Security Assessments
 
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
 

Similar to 07 automate windowsenvironmentswithansibleanddsc

Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSC
Mmik Huang
 
Morning Coffee - Windows Server 2016
Morning Coffee - Windows Server 2016Morning Coffee - Windows Server 2016
Morning Coffee - Windows Server 2016
Primend
 
Private Cloud Academy: Backup and DPM 2010
Private Cloud Academy: Backup and DPM 2010Private Cloud Academy: Backup and DPM 2010
Private Cloud Academy: Backup and DPM 2010
Aidan Finn
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
Maarten Balliauw
 
Building & managing wa app wely
Building & managing wa app   welyBuilding & managing wa app   wely
Building & managing wa app welySpiffy
 
Building & Managing Windows Azure
Building & Managing Windows AzureBuilding & Managing Windows Azure
Building & Managing Windows AzureK.Mohamed Faizal
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
Mehmet Ali Aydın
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
Tim Fairweather
 
WindowsAzureSDK1.7
WindowsAzureSDK1.7WindowsAzureSDK1.7
WindowsAzureSDK1.7Saravanan G
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OS
Julian Dunn
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShell
Alexander Feschenko
 
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSCWinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
WinOps Conf
 
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-418CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
sivakumarmcs
 
Managing Azure Components Using Azure PowerShell
Managing Azure Components Using Azure PowerShellManaging Azure Components Using Azure PowerShell
Managing Azure Components Using Azure PowerShell
Nitesh Luharuka
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressGeorge Kanellopoulos
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
CodeMill digital skills
 
Sdwest2008 V101 F Dpowerpoint Final
Sdwest2008 V101 F Dpowerpoint FinalSdwest2008 V101 F Dpowerpoint Final
Sdwest2008 V101 F Dpowerpoint FinalStephen Rose
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azureCEDRIC DERUE
 

Similar to 07 automate windowsenvironmentswithansibleanddsc (20)

Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSC
 
Morning Coffee - Windows Server 2016
Morning Coffee - Windows Server 2016Morning Coffee - Windows Server 2016
Morning Coffee - Windows Server 2016
 
Private Cloud Academy: Backup and DPM 2010
Private Cloud Academy: Backup and DPM 2010Private Cloud Academy: Backup and DPM 2010
Private Cloud Academy: Backup and DPM 2010
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
 
Building & managing wa app wely
Building & managing wa app   welyBuilding & managing wa app   wely
Building & managing wa app wely
 
Building & Managing Windows Azure
Building & Managing Windows AzureBuilding & Managing Windows Azure
Building & Managing Windows Azure
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
WindowsAzureSDK1.7
WindowsAzureSDK1.7WindowsAzureSDK1.7
WindowsAzureSDK1.7
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OS
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShell
 
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSCWinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
WinOps Conf 2016 - Ed Wilson - Configuration Management with Azure DSC
 
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-418CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-4
 
Managing Azure Components Using Azure PowerShell
Managing Azure Components Using Azure PowerShellManaging Azure Components Using Azure PowerShell
Managing Azure Components Using Azure PowerShell
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
Sdwest2008 V101 F Dpowerpoint Final
Sdwest2008 V101 F Dpowerpoint FinalSdwest2008 V101 F Dpowerpoint Final
Sdwest2008 V101 F Dpowerpoint Final
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
 

More from Khairul Zebua

Ansible - From Zero to Hero.pptx
Ansible - From Zero to Hero.pptxAnsible - From Zero to Hero.pptx
Ansible - From Zero to Hero.pptx
Khairul Zebua
 
Extending Agile with DevOps Mindset
Extending Agile with DevOps MindsetExtending Agile with DevOps Mindset
Extending Agile with DevOps Mindset
Khairul Zebua
 
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATAGet rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
Khairul Zebua
 
Brace yourself alerts are coming (case study tokopedia)
Brace yourself alerts are coming (case study tokopedia)Brace yourself alerts are coming (case study tokopedia)
Brace yourself alerts are coming (case study tokopedia)
Khairul Zebua
 
DevOps Monitoring and Alerting
DevOps Monitoring and AlertingDevOps Monitoring and Alerting
DevOps Monitoring and Alerting
Khairul Zebua
 
Ansible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD ProcessAnsible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD Process
Khairul Zebua
 
DevOps Indonesia Presentation
DevOps Indonesia PresentationDevOps Indonesia Presentation
DevOps Indonesia Presentation
Khairul Zebua
 
DevOps at Tokopedia - DevOps Indonesia
DevOps at Tokopedia - DevOps IndonesiaDevOps at Tokopedia - DevOps Indonesia
DevOps at Tokopedia - DevOps Indonesia
Khairul Zebua
 
08 red hattrainingandcertification
08 red hattrainingandcertification08 red hattrainingandcertification
08 red hattrainingandcertification
Khairul Zebua
 
04 accelerating businessvaluewithdevops
04 accelerating businessvaluewithdevops04 accelerating businessvaluewithdevops
04 accelerating businessvaluewithdevops
Khairul Zebua
 
02 ansible automateskeynote-jakarta
02 ansible automateskeynote-jakarta02 ansible automateskeynote-jakarta
02 ansible automateskeynote-jakarta
Khairul Zebua
 
03 ansible towerbestpractices-nicholas
03 ansible towerbestpractices-nicholas03 ansible towerbestpractices-nicholas
03 ansible towerbestpractices-nicholas
Khairul Zebua
 

More from Khairul Zebua (12)

Ansible - From Zero to Hero.pptx
Ansible - From Zero to Hero.pptxAnsible - From Zero to Hero.pptx
Ansible - From Zero to Hero.pptx
 
Extending Agile with DevOps Mindset
Extending Agile with DevOps MindsetExtending Agile with DevOps Mindset
Extending Agile with DevOps Mindset
 
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATAGet rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
Get rid of obstacles with DevOps Mindset - IT Tech Talk #2 XL AXIATA
 
Brace yourself alerts are coming (case study tokopedia)
Brace yourself alerts are coming (case study tokopedia)Brace yourself alerts are coming (case study tokopedia)
Brace yourself alerts are coming (case study tokopedia)
 
DevOps Monitoring and Alerting
DevOps Monitoring and AlertingDevOps Monitoring and Alerting
DevOps Monitoring and Alerting
 
Ansible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD ProcessAnsible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD Process
 
DevOps Indonesia Presentation
DevOps Indonesia PresentationDevOps Indonesia Presentation
DevOps Indonesia Presentation
 
DevOps at Tokopedia - DevOps Indonesia
DevOps at Tokopedia - DevOps IndonesiaDevOps at Tokopedia - DevOps Indonesia
DevOps at Tokopedia - DevOps Indonesia
 
08 red hattrainingandcertification
08 red hattrainingandcertification08 red hattrainingandcertification
08 red hattrainingandcertification
 
04 accelerating businessvaluewithdevops
04 accelerating businessvaluewithdevops04 accelerating businessvaluewithdevops
04 accelerating businessvaluewithdevops
 
02 ansible automateskeynote-jakarta
02 ansible automateskeynote-jakarta02 ansible automateskeynote-jakarta
02 ansible automateskeynote-jakarta
 
03 ansible towerbestpractices-nicholas
03 ansible towerbestpractices-nicholas03 ansible towerbestpractices-nicholas
03 ansible towerbestpractices-nicholas
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

07 automate windowsenvironmentswithansibleanddsc

  • 1. Kok Hui Lew Specialist Solution Architect Automate Windows Environments with Ansible and DSC
  • 2. Agenda ● Windows Management with Ansible ● What is DSC? ● Why use DSC with Ansible? ● Where to use Ansible Windows Modules vs DSC resources? ● Compare and contrast Windows Modules and DSC resource examples ● Credential Management ● Example Playbooks
  • 3. SIMPLE POWERFUL AGENTLESS App deployment Configuration management Workflow orchestration Network automation Orchestrate the app lifecycle Human readable automation No special coding skills needed Tasks executed in order Usable by every team Get productive quickly Agentless architecture Uses OpenSSH & WinRM No agents to exploit or update Get started immediately More efficient & more secure WHY ANSIBLE?
  • 4. 70+ Windows Modules Use Ansible to deploy and manage Windows systems and applications. ANSIBLE WINDOWS AUTOMATION ansible.com/windows 350+ Powershell DSC resources
  • 5. - hosts: new_servers tasks: - name: ensure common OS updates are current win_updates: register: update_result - name: ensure domain membership win_domain_membership: dns_domain_name: contoso.corp domain_admin_user: '{{ domain_admin_username }}' domain_admin_password: '{{ domain_admin_password }}' state: domain register: domain_result - name: reboot and wait for host if updates or domain change require it win_reboot: when: update_result.reboot_required or domain_result.reboot_required - name: ensure local admin account exists win_user: name: localadmin password: '{{ local_admin_password }}' groups: Administrators - name: ensure common tools are installed win_chocolatey: name: '{{ item }}' with_items: ['sysinternals', 'googlechrome'] PLAYBOOK EXAMPLE: WINDOWS
  • 6. What is DSC? > Windows Management Platform built in ● Ships natively with Windows Server 2012 R2 and Windows 8.1 and newer ● Requires PowerShell v4 or greater > Configuration based declarative model ● Define desired state in configuration ● DSC determines how to execute on target > Push or Pull Architecture
  • 7. Why Use DSC with Ansible? Both declarative & end-state oriented Scale using Ansible lightweight architecture Compliment each other Rich community ecosystem for both Ansible Tower provides enterprise capabilities managing Windows Extend end-to-end use cases beyond Windows management
  • 8. Where to use Ansible Windows Modules vs DSC resources? Reasons for using an Ansible module over a DSC resource: ● The host does not support PowerShell v5.0, or it cannot easily be upgraded ● The DSC resource does not offer a feature present in an Ansible module ● DSC resources have limited check mode support, while some Ansible modules have better checks ● DSC resources do not support diff mode, while some Ansible modules do ● Custom resources require further installation steps to be run on the host beforehand, while Ansible modules are in built-in to Ansible Reasons for using a DSC resource over an Ansible module: ● The Ansible module does not support a feature present in a DSC resource ● There is no Ansible module available
  • 9. - name: Install IIS Web-Server win_feature: name: Web-Server state: present restart: True include_sub_features: True include_management_tools: True - name: Create IIS site win_iis_website: name: Ansible state: started physical_path: c:sitesAnsible - name: Add HTTP webbinding to IIS win_iis_webbinding: name: Ansible protocol: http port: 8080 ip: '*' state: present Example playbooks with Ansible Modules vs DSC resources - name: Install required DSC module win_psmodule: name: xWebAdministration state: present - name: Install IIS Web-Server win_dsc: resource_name: windowsfeature name: Web-Server - name: Create IIS site win_dsc: resource_name: xWebsite Ensure: Present Name: Ansible State: Started PhysicalPath: c:sitesAnsible BindingInfo: - Protocol: http Port: 8080 IPAddress: '*'
  • 10. - name: Install required DSC module win_psmodule: name: xWebAdministration state: present - name: Install IIS Web-Server win_dsc: resource_name: windowsfeature name: Web-Server - name: Create IIS site win_dsc: resource_name: xWebsite Ensure: Present Name: Ansible State: Started PhysicalPath: c:sitesAnsible BindingInfo: - Protocol: http Port: 8080 IPAddress: '*' Use win_dsc module vs Powershell # Import the module Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $NodeName { # Install the IIS role WindowsFeature IIS { Ensure = 'Present' Name = 'Web-Server' } xWebsite DefaultSite { Ensure = 'Present' Name = 'Ansible' State = 'Started' PhysicalPath = 'c:sitesAnsible' DependsOn = '[WindowsFeature]IIS' BindingInfo = MSFT_xWebBindingInformation { Protocol = 'http' Port = '8080' IPAddress = '*' } } }
  • 11. Handle Credentials with win_dsc Module ● By default win_dsc module uses SYSTEM account ● You can use PsDscRunAsCredential attribute to run as another user: - name: use win_dsc with PsDscRunAsCredential to run as a different user win_dsc: resource_name: Registry Ensure: Present Key: HKEY_CURRENT_USERExampleKey ValueName: TestValue ValueData: TestData PsDscRunAsCredential_username: '{{ ansible_user }}' PsDscRunAsCredential_password: '{{ ansible_password }}' no_log: true
  • 12. Some Example DSC Resources ● Built-in: ○ Archive ○ File ○ Group ○ Package ○ WindowsFeature ○ And more.. ● Custom resources provided by Microsoft and the community: ○ Domain Controller ○ IIS Web Site ○ SQL Server Cluster ○ Failover Cluster ○ DNS ○ And many more..
  • 13. 13 CONFIDENTIAL Beyond Server Management - Rolling Update Example Your applications and systems are more than just collections of configurations. They’re a finely tuned and ordered list of tasks and processes that result in your working application. Ansible can do it all: • Provisioning • App Deployment • Configuration Management • Multi-tier Orchestration
  • 14. How to obtain a list of Ansible Windows Modules and DSC Resources ● Ansible Modules: ○ https://docs.ansible.com/ansible/latest/modules/list_of_windows_modules.html ● Built-in DSC Resources: ○ https://docs.microsoft.com/en-us/powershell/dsc/builtinresource ○ Or run this powershell command: Find-DscResource ● DSC Resources on Github: ○ https://github.com/PowerShell/DscResources ● DSC Resources on Powershell Gallery: ○ https://www.powershellgallery.com