├── .gitignore ├── 2hosts ├── MANIFEST.in ├── README.md ├── aap ├── AlienInvasion.yml ├── ansible.cfg ├── aws-ec2-demo │ ├── README.md │ ├── aws-demo-wf-1.yml │ ├── aws-demo-wf-2.yml │ ├── aws-demo-wf-3.yml │ └── aws │ │ ├── roles │ │ ├── linux │ │ │ ├── apps │ │ │ │ └── web │ │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ │ ├── tasks │ │ │ │ │ ├── copy_code.yml │ │ │ │ │ ├── install_httpd.yml │ │ │ │ │ └── main.yml │ │ │ │ │ ├── templates │ │ │ │ │ └── index.html.j2 │ │ │ │ │ └── vars │ │ │ │ │ └── main.yml │ │ │ ├── postcreate │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── tasks │ │ │ │ │ └── main.yml │ │ │ │ ├── templates │ │ │ │ │ ├── ntp.conf.j2 │ │ │ │ │ └── ssh_howto.j2 │ │ │ │ └── vars │ │ │ │ │ └── main.yml │ │ │ └── provision │ │ │ │ ├── tasks │ │ │ │ └── main.yml │ │ │ │ └── vars │ │ │ │ └── main.yml │ │ └── windows │ │ │ ├── postcreate │ │ │ ├── handlers │ │ │ │ └── main.yml │ │ │ ├── tasks │ │ │ │ └── main.yml │ │ │ └── vars │ │ │ │ └── main.yml │ │ │ └── provision │ │ │ ├── tasks │ │ │ └── main.yml │ │ │ └── vars │ │ │ └── main.yml │ │ └── site.yml ├── azure-rg-vm-discovery.yml ├── bad_syntax.yml ├── bpm-ansible-demo │ ├── README.md │ └── aws │ │ ├── roles │ │ ├── linux │ │ │ ├── apps │ │ │ │ └── web │ │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ │ ├── tasks │ │ │ │ │ ├── copy_code.yml │ │ │ │ │ ├── install_httpd.yml │ │ │ │ │ └── main.yml │ │ │ │ │ ├── templates │ │ │ │ │ └── index.html.j2 │ │ │ │ │ └── vars │ │ │ │ │ └── main.yml │ │ │ ├── postcreate │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── tasks │ │ │ │ │ └── main.yml │ │ │ │ ├── templates │ │ │ │ │ ├── ntp.conf.j2 │ │ │ │ │ └── ssh_howto.j2 │ │ │ │ └── vars │ │ │ │ │ └── main.yml │ │ │ └── provision │ │ │ │ ├── tasks │ │ │ │ └── main.yml │ │ │ │ └── vars │ │ │ │ └── main.yml │ │ └── windows │ │ │ ├── postcreate │ │ │ ├── handlers │ │ │ │ └── main.yml │ │ │ ├── tasks │ │ │ │ └── main.yml │ │ │ └── vars │ │ │ │ └── main.yml │ │ │ └── provision │ │ │ ├── tasks │ │ │ └── main.yml │ │ │ └── vars │ │ │ └── main.yml │ │ └── site.yml ├── delete-vm-azure-instance-stack.yml ├── delete-vm-vsphere.yml ├── deploy-vm-amazon-ami.yml ├── deploy-vm-azure-instance-stack-surveys.yml ├── deploy-vm-azure-instance-stack.yml ├── deploy-vm-azure.yml ├── deploy-vm-gcp.yml ├── deploy-vm-vsphere-from-template.yml ├── deploy-vm-vsphere-from-template2.yml ├── download-and-copy.yml ├── files │ └── local_copy_a ├── hub-collection-test.yml ├── library │ └── scan_foo.py ├── linux-account-blocks-eg.yml ├── linux-account-blocks.yml ├── linux-accounts.yml ├── long-sleep.yml ├── long_lines.yml ├── motd ├── patch-rhel-hosts.yml ├── ping-pong.yml ├── poc-rhv-discover-using-vault-creds.yml ├── poc-rhv-discover.yml ├── poc-vcenter-deploy-vm-template.yml ├── post-provision-aws.yml ├── post-provision.yml ├── rear │ └── local.conf ├── rhel7-rear.yml ├── sanity-check-aws.yml ├── sanity-check.yml ├── scan_custom.yml ├── showmepw.yml ├── snow-create-record.yml ├── snow-get-record.yml ├── snow-update-record.yml ├── touch-and-sleep.yml └── write_files.yml ├── abc.yml ├── amazon.yml ├── ara-example.yml ├── assert-eg.yml ├── async-fire-forget.yml ├── azure-pipelines.yml ├── azure-rg.yml ├── azure.yml ├── blocks-eg.yml ├── check_group_ordering.yml ├── collections ├── README.md ├── requirements.old └── requirements.yml ├── create-ami-amazon.yml ├── create-bare-metal-server-packetnet.yml ├── custom_chkuser.yml ├── custom_chkuser_tower.yml ├── custom_wheelgrpchk.yml ├── delete-vm-vsphere.yml ├── dell ├── idrac_discovery.yml └── inventory │ ├── idrac_hosts │ └── idrac_hosts_constructed_inv.yml ├── deploy-vm-amazon.yml ├── deploy-vm-azure-cmdline.yml ├── deploy-vm-azure.yml ├── deploy-vm-gcp.yml ├── deploy-vm-rhv.yml ├── deploy-vm-vsphere-from-template.yml ├── deploy-vm-vsphere.yml ├── deploy-vn-azure-cmdline.yml ├── directory-structure.txt ├── dynamic_inv_ping_check.yml ├── example-detect-reboot-and-wait.yml ├── extras.yml ├── first-checks.yml ├── fix-rhel-vulnerable.yml ├── good-eg.yml ├── hello-world.yml ├── hosts ├── immutablish-deploys ├── README.md ├── ansible.cfg ├── blue.yml ├── build_ami.yml ├── cfn_update_policy.yml ├── inventory │ ├── group_vars │ │ ├── all │ │ ├── apps │ │ ├── colors │ │ └── just_added │ ├── host_vars │ │ ├── amibuilder │ │ ├── fancyapp-blue │ │ ├── fancyapp-cfn │ │ ├── fancyapp-rolling │ │ ├── fancyapp-violet │ │ └── localhost │ └── hosts ├── roles │ ├── apache │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── Debian.yml │ │ │ ├── RedHat.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ └── index.html.j2 │ │ └── vars │ │ │ ├── Debian.yml │ │ │ ├── RedHat.yml │ │ │ └── main.yml │ ├── asgcfn │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── asg_lc.json │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── dual_asg │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── main.yml │ │ │ └── terminate_relative.yml │ │ └── vars │ │ │ └── main.yml │ ├── infra │ │ ├── README.md │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ └── rolling_asg │ │ ├── README.md │ │ ├── defaults │ │ └── main.yml │ │ ├── handlers │ │ └── main.yml │ │ ├── meta │ │ └── main.yml │ │ ├── tasks │ │ └── main.yml │ │ └── vars │ │ └── main.yml ├── rolling_ami.yml ├── vars │ └── .gitignore └── violet.yml ├── inv.yml ├── inv_5hosts ├── inv_simple_1k_hosts.ini ├── inventory_test ├── journalctl-persist.yml ├── kindle-demo.yml ├── lamp_simple_rhel7 ├── LICENSE.md ├── README.md ├── group_vars │ ├── all │ └── dbservers ├── hosts ├── roles │ ├── common │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── ntp.conf.j2 │ ├── db │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ └── web │ │ ├── tasks │ │ ├── copy_code.yml │ │ ├── install_httpd.yml │ │ └── main.yml │ │ └── templates │ │ └── index.php.j2 └── site.yml ├── library ├── chkuptime ├── chkuser └── chkwheelgrp ├── make-rhel-vulnerable.yml ├── multi_cloud ├── README.md ├── group_vars │ ├── all │ ├── amazon │ └── azure ├── hosts ├── roles │ ├── amazon │ │ └── tasks │ │ │ ├── amazon.yml │ │ │ ├── install_httpd.yml │ │ │ └── main.yml │ ├── azure │ │ └── tasks │ │ │ ├── azure.yml │ │ │ └── main.yml │ └── common │ │ ├── handlers │ │ └── main.yml │ │ ├── tasks │ │ └── main.yml │ │ └── templates │ │ └── ntp.conf.j2 └── site.yml ├── networking ├── ios_reporting.yml └── report-ios.j2 ├── openSCAP.yml ├── ops ├── roles │ ├── config │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ ├── issue-Amazon.j2 │ │ │ └── issue-RedHat.j2 │ ├── disk │ │ └── tasks │ │ │ └── main.yml │ └── services │ │ ├── defaults │ │ └── main.yml │ │ └── tasks │ │ └── main.yml └── site.yml ├── ping.yml ├── ping_check.yml ├── post-provision.yml ├── reboot.yml ├── rhsm-aws-tower.yml ├── rhsm-ocp-example.yml ├── rngd.yml ├── rolling-upgrade-demo1 ├── LICENSE.md ├── README.md ├── group_vars │ └── all ├── roles │ ├── common │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── ntp.conf.j2 │ ├── haproxy │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install-haproxy.yml │ │ │ └── main.yml │ │ └── templates │ │ │ └── haproxy.j2 │ └── webservers │ │ ├── handlers │ │ └── main.yml │ │ └── tasks │ │ ├── install-apache.yml │ │ └── main.yml └── site.yml ├── run-redhat-insights.yml ├── slack.yml ├── snow_collection_example.yml ├── start_azure_vms.yml ├── sysadmin ├── group_vars │ └── all ├── roles │ ├── common │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── ntp.conf.j2 │ └── web │ │ ├── tasks │ │ ├── copy_code.yml │ │ ├── install_httpd.yml │ │ └── main.yml │ │ └── templates │ │ └── index.php.j2 └── site.yml ├── telegram.yml ├── vm_orchestration ├── README.md ├── offpremise │ ├── roles │ │ ├── common │ │ │ ├── handlers │ │ │ │ └── main.yml │ │ │ ├── tasks │ │ │ │ └── main.yml │ │ │ ├── templates │ │ │ │ └── ntp.conf.j2 │ │ │ └── vars │ │ │ │ └── main.yml │ │ └── offprem │ │ │ ├── tasks │ │ │ ├── amazon.yml │ │ │ ├── bootstrap.yml │ │ │ └── main.yml │ │ │ └── vars │ │ │ └── main.yml │ └── site.yml └── onpremise │ ├── roles │ ├── common │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ ├── templates │ │ │ └── ntp.conf.j2 │ │ └── vars │ │ │ └── main.yml │ └── onprem │ │ ├── tasks │ │ ├── main.yml │ │ └── vcenter.yml │ │ └── vars │ │ └── main.yml │ └── site.yml └── windows ├── README.md ├── check_psversion.yml ├── check_quicktime.yml ├── configure_desktops.yml ├── copssh.yml ├── customise-chrome.yml ├── deploy_iis_code.yml ├── deploy_web_site.yml ├── disable_sso_account.yml ├── event_logging.yml ├── getmem.yml ├── hosts ├── inform-bpm.yml ├── ipconfig.yml ├── library └── win_git.ps1 ├── openssh-win32.txt ├── openssh.yml ├── password-management.yml ├── ping.yml ├── remove_software.yml ├── roles ├── win-ad-config │ ├── defaults │ │ └── main.yml │ ├── tasks │ │ ├── configure_groups.yml │ │ ├── configure_users.yml │ │ └── main.yml │ └── vars │ │ ├── groups.yml │ │ └── users.yml ├── win-domain-pw-check │ └── tasks │ │ └── main.yml ├── win-domain-user │ └── tasks │ │ └── main.yml └── win-local-user │ └── tasks │ └── main.yml ├── scripts ├── get_sw.ps1 └── mem.ps1 ├── setup_iis.yml ├── sysinternals.yml ├── templates ├── delete_ad_account.j2 ├── disable_ad_account.j2 └── download-openssh.j2 ├── various.yml ├── win-ad-config.yml ├── win-auth-tasks-api.yml ├── win-auth-tasks.yml ├── win-domain-add-user.yml ├── win-extras.yml ├── win_updates.yml ├── winrm_ipconfig.py └── winrm_mem.py /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore some stuff 2 | inventory 3 | credentials 4 | *fact* 5 | *key* 6 | *.retry 7 | *cachedir* 8 | cachedir/* 9 | .vscode 10 | .ansible* 11 | ansible.cfg 12 | 13 | # Packages 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases 24 | *.log 25 | *.sql 26 | *.sqlite 27 | 28 | # OS generated files 29 | .DS_Store 30 | .DS_Store? 31 | ._* 32 | .Spotlight-V100 33 | .Trashes 34 | ehthumbs.db 35 | Thumbs.db 36 | -------------------------------------------------------------------------------- /2hosts: -------------------------------------------------------------------------------- 1 | [foogroup] 2 | foo1 instance_group=foo_ig_a 3 | foo2 instance_group=foo_ig_b 4 | [foogroup:vars] 5 | instance_group="foo_ig_default" 6 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | exclude .git * 2 | recursive-exclude * * 3 | recursive-include tower *.yml 4 | include 2hosts 5 | include hosts 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible All The Things! 2 | 3 | My random assortment of Ansible stuff 4 | 5 | -------------------------------------------------------------------------------- /aap/AlienInvasion.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Deploy AlienInvasion Game 3 | hosts: all 4 | gather_facts: false 5 | become: true 6 | 7 | vars: 8 | git_branch: devel 9 | endpoint: game 10 | 11 | tasks: 12 | - name: Install Software Required 13 | yum: 14 | name: "{{ packages }}" 15 | vars: 16 | packages: 17 | - httpd 18 | - git 19 | tags: software 20 | 21 | - name: Git Clone Repo on to Web Servers 22 | git: 23 | repo: 'https://gitlab.com/ffirg/AlienInvasion.git' 24 | dest: "/var/www/html/{{ endpoint }}" 25 | version: "{{ git_branch }}" 26 | force: yes 27 | tags: content 28 | 29 | - name: Start Web Services 30 | service: 31 | name: httpd 32 | state: started 33 | tags: service 34 | 35 | - name: Smoke Testing 36 | uri: 37 | url: "http://{{ public_ip }}/{{ endpoint }}" 38 | -------------------------------------------------------------------------------- /aap/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | callbacks_enabled = timer, profile_tasks, profile_roles 3 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/README.md: -------------------------------------------------------------------------------- 1 | # This is an AWS ec2 cloud VM creation demo 2 | 3 | ``` 4 | This is designed to be run from Ansible Tower, but can be called via a REST job_template launch 5 | ``` 6 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws-demo-wf-1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: tag_Name_just_created_linux 3 | become: no 4 | become_method: sudo 5 | gather_facts: false 6 | 7 | tasks: 8 | - name: Test connection 9 | ping: 10 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws-demo-wf-2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: tag_Name_just_created_linux 3 | become: yes 4 | become_method: sudo 5 | gather_facts: false 6 | 7 | tasks: 8 | - name: Create ops user accounts 9 | user: 10 | name=bill comment="Bill Rogers" uid=1102 groups=wheel append=yes 11 | name=ted comment="Ted Wonderful" uid=1103 groups=wheel append=yes 12 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws-demo-wf-3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: tag_Name_just_created_linux 3 | become: yes 4 | become_method: sudo 5 | gather_facts: true 6 | 7 | tasks: 8 | 9 | - name: Install Samba and misc packages 10 | yum: name={{item}} state=present 11 | with_items: 12 | - samba-4.2.3-12.el7_2 13 | - samba-client-libs-4.2.3-12.el7_2 14 | - wget 15 | when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' 16 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws/roles/linux/apps/web/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Handler to handle common notifications. 3 | 4 | - name: restart web server 5 | service: name=httpd state=restarted 6 | 7 | - name: restart firewall 8 | service: name=firewalld state=restarted 9 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws/roles/linux/apps/web/tasks/copy_code.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Creates some front-of-shop web content so we can demo something 3 | 4 | - name: Create a index.html file 5 | template: src=index.html.j2 dest=/var/www/html/index.html 6 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws/roles/linux/apps/web/tasks/install_httpd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # These tasks install http and the php modules. 3 | 4 | - name: Install web and associated packages 5 | yum: name={{ item }} state=present 6 | with_items: 7 | - httpd 8 | - php 9 | - php-mysql 10 | - git 11 | - libsemanage-python 12 | - libselinux-python 13 | 14 | #- name: insert firewalld rule for httpd 15 | # firewalld: port={{ httpd_port }}/tcp permanent=true state=enabled immediate=yes 16 | 17 | - name: Start the web service 18 | service: name=httpd state=started enabled=yes 19 | 20 | - name: Configure SELinux to allow httpd to connect to remote database 21 | seboolean: name=httpd_can_network_connect_db state=true persistent=yes 22 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws/roles/linux/apps/web/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include: install_httpd.yml 3 | - include: copy_code.yml 4 | -------------------------------------------------------------------------------- /aap/aws-ec2-demo/aws/roles/linux/apps/web/templates/index.html.j2: -------------------------------------------------------------------------------- 1 | 2 |
3 |Hostname | 11 |Model Type | 12 |Serial Number | 13 |Mgmt interface IP | 14 |Code Version | 15 |
---|---|---|---|---|
{{hostvars[network_switch]['ansible_net_hostname']}} | 21 |{{hostvars[network_switch]['ansible_net_model']}} | 22 |{{hostvars[network_switch]['ansible_net_serialnum']}} | 23 |{{hostvars[network_switch]['ansible_net_interfaces']['GigabitEthernet1']['ipv4'][0]['address']}} | 24 |{{hostvars[network_switch]['ansible_net_version']}} | 25 |