Code Monkey home page Code Monkey logo

sa-box-bootstrap-win's Introduction

Build Status

Example of usage:

Simple

  vars:
    - box_choco_core_packages:
        - chocolatey-core.extension
        - far
        - git
        - conemu
        - winrar
        - 7zip.install


  roles:
     - {
         role: "sa-box-bootstrap-win",
         timezone: "Central European Standard Time",

         option_install_choco: true,
         choco_core_packages: "{{box_choco_core_packages}}",

         option_install_roaming_profile: true,
         powershell_roaming_profile: "https://github.com/Voronenko/winfiles.git"         

       }

Advanced

  vars:
    - root_dir: ..
    - timezone: "Central European Standard Time"

    - box_windows_iis_features:
      -  "IIS-BasicAuthentication"
      -  "IIS-DefaultDocument"
      -  "IIS-DirectoryBrowsing"
      -  "IIS-HttpCompressionDynamic"
      -  "IIS-HttpCompressionStatic"
      -  "IIS-HttpErrors"
      -  "IIS-HttpLogging"
      -  "IIS-ISAPIExtensions"
      -  "IIS-ISAPIFilter"
      -  "IIS-ManagementConsole"
      -  "IIS-RequestFiltering"
      -  "IIS-StaticContent"
      -  "IIS-WebSockets"
      -  "IIS-WindowsAuthentication"

    - box_windows_aspnet_features:
      - "NetFx3"
      - "NetFx4-AdvSrvs"
      - "NetFx4Extended-ASPNET45"
      - "IIS-NetFxExtensibility"
      - "IIS-NetFxExtensibility45"
      - "IIS-ASPNET"
      - "IIS-ASPNET45"

    - box_choco_core_packages:
        - chocolatey-core.extension
        - far
        - git
        - conemu
        - winrar
        - 7zip.install



  pre_tasks:
    - debug: msg="Pre tasks section"

  roles:
     - {
         role: "sa-box-bootstrap-win",
         timezone: "Europe/Kiev",

         option_install_choco: true,
         option_install_iis_features: true,
         option_install_aspnet_features: true,

         windows_iis_features: "{{box_windows_iis_features}}",
         windows_aspnet_features: "{{box_windows_aspnet_features}}",
         choco_core_packages: "{{box_choco_core_packages}}",

         option_install_roaming_profile: true,
         powershell_roaming_profile: "https://github.com/Voronenko/winfiles.git"         
         
       }

Windows System Prep

Unless you haven't proceeded yet, make sure you prepared system according steps at http://docs.ansible.com/ansible/latest/intro_windows.html#windows-system-prep

In order for Ansible to manage your windows machines, you will have to enable and configure PowerShell remoting. To automate the setup of WinRM, you can run the examples/scripts/ConfigureRemotingForAnsible.ps1 script on the remote machine in a PowerShell console as an administrator.

The example script accepts a few arguments which Admins may choose to use to modify the default setup slightly, which might be appropriate in some cases.

Pass the -CertValidityDays option to customize the expiration date of the generated certificate:

powershell.exe -File ConfigureRemotingForAnsible.ps1 -CertValidityDays 100

Pass the -EnableCredSSP switch to enable CredSSP as an authentication option:

powershell.exe -File ConfigureRemotingForAnsible.ps1 -EnableCredSSP

Pass the -ForceNewSSLCert switch to force a new SSL certificate to be attached to an already existing winrm listener. (Avoids SSL winrm errors on syspreped Windows images after the CN changes):

powershell.exe -File ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert

Pass the -SkipNetworkProfileCheck switch to configure winrm to listen on PUBLIC zone interfaces. (Without this option, the script will fail if any network interface on device is in PUBLIC zone):

powershell.exe -File ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck

To troubleshoot the ConfigureRemotingForAnsible.ps1 writes every change it makes to the Windows EventLog (useful when run unattendedly). Additionally the -Verbose option can be used to get more information on screen about what it is doing.

Envelope size

If you are going to install big enough packages, you need to increase MaxEnvelopeSizekb setting

winrm set winrm/config @{MaxEnvelopeSizekb="8192"}.

Points of interest

You can reuse this playbook to create your own box bootstaping projects, and reuse the role to configure your environments quicker in secure way with ansible

Usage with ansible galaxy workflow

If you installed the sa-box-bootsrap-win role using the command

ansible-galaxy install softasap.sa-box-bootsrap-win

the role will be available in the folder library/softasap.sa-box-bootsrap-win Please adjust the path accordingly.

     - {
         role: "softasap.sa-box-bootsrap-win"
       }

Copyright and license

Code is dual licensed under the [BSD 3 clause] (https://opensource.org/licenses/BSD-3-Clause) and the [MIT License] (http://opensource.org/licenses/MIT). Choose the one that suits you best.

Reach us:

Subscribe for roles updates at [FB] (https://www.facebook.com/SoftAsap/)

Join gitter discussion channel at Gitter

Discover other roles at http://www.softasap.com/roles/registry_generated.html

visit our blog at http://www.softasap.com/blog/archive.html

sa-box-bootstrap-win's People

Contributors

voronenko avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.