GithubHelp home page GithubHelp logo

ansible-win-ad's Introduction

Ansible - Active Directory

Install Active Directory (AD) for demo or labbing purposes on a Microsoft Windows Server 2012 R2 Standard.

Requirements for VM

Requirements on Ansible controller

Ensure required packages are present.

# Ubuntu 20.04
sudo apt update
sudo apt install -Vy vim git screen wget telnet python3-pip
sudo apt install -Vy python3.8-venv
mkdir python-virtual-environments && cd python-virtual-environments
python3 -m venv ansible
source ~/python-virtual-environments/ansible/bin/activate
pip3 install ansible-lint ansible
pip3 install "pywinrm>=0.2.2"

Ensure your BASH is recent on MacOS, otherwise globstar does not work.

brew install bash
chsh -s /usr/local/bin/bash
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
ln -s /usr/local/bin/bash /usr/local/bin/bash-terminal-app
  • pip install ansible-lint Linting used in combination with Git pre-commit hooks
  • pip install pre-commit to run Git pre-commit hooks
  • (optional) If using Python virtual environment (venv), then run source ~/venvs/ansible/bin/activate

Keep in mind, pre-commit run (with no additional arguments) only runs against currently staged files.

Edit the inventory

Fill the following vars that are required by the Ansible roles.

# fill these vars
# example values below
win_ad_install_ad_domain_name: "adfs2.manderson-it.ca" # FQDN ad1.mydomain.ca
win_ad_install_ad_netbios_name: "adir" # Until first dot of FQDN
password_for_all="" # used by role win_ad_user 

Run Playbooks

Playbooks are run against the Windows machine. Make sure you meet the above requirements. Append -u gcp_user_for_windows to below ansible-playbook commands.

ansible-playbook playbooks/win_deploy_ad.yml
ansible-playbook playbooks/win_ad_users_groups.yml
ansible-playbook playbooks/win_ssh_server.yml
ansible-playbook playbooks/win_ping.yml

If you run Ansible from macOS: macOS has some Python bug, which results in the following output when calling an Ansible playbook with win_ping, for example.

[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called

If you see this error on macOS, export the following environment variable before running the playbook.

# Might be needed on MacOS due to a Python bug
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

ansible-win-ad's People

Contributors

manderson-it avatar

Stargazers

 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.