Git Product home page Git Product logo

activedirectory-lab's People

Contributors

cfalta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

activedirectory-lab's Issues

Workaround for 'sleep' resource

Just thought I'd share here, since I spent some time getting this to work...

I had problems with the sleep resource occasionally not being long enough causing the terraform to fail at the join_domain resource, so I searched for a way to test the DC dynamically and came up with the following. It does use the CustomScriptExtension, which you can [absurdly] only have one of for a VM, so take that into consideration.

locals { 
 ...
  # use the nltest command to see if the domain controller is fully is up
  wait_for_dc          = "while (-not(((nltest /dsgetdc:${var.active_directory_domain}) | Out-String).Contains('successfully'))) { sleep 10 } ; Write-Host 'Successful'"
}

##########################################################
# Wait - we need this to give the DC enough time to provision before joining VMs
##########################################################

# we have intermittent failures in joining the domain that appear to be timing-related (DC not fully up yet).
# this is to avoid a long static sleep
resource "azurerm_virtual_machine_extension" "wait_for_dc" {
  count = var.node_count
  virtual_machine_id   = azurerm_windows_virtual_machine.member_vm[count.index].id
  name                 = "wait_for_dc"
  publisher            = "Microsoft.Compute"
  type                 = "CustomScriptExtension"
  type_handler_version = "1.10"
  auto_upgrade_minor_version = true

  settings = <<SETTINGS
    {
        "commandToExecute": "powershell.exe -Command \"${local.wait_for_dc}\""
    }
SETTINGS
}

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.