Giter Site home page Giter Site logo

ansible-github-enterprise's Introduction

ansible-github-enterprise

Ansible playbook for GitHub Enterprise

This playbook assumes you are running GitHub Enterprise under SSL.

Requirements

  • This playbook has been tested with Ansible running Python 3.8.x

Roles

  • upgrade_ghe - upgrade GHE to latest version (as determined by ghe-update-check)

Configuration

For dev, stage, prod, etc., create an inventory and variable file for each infrastructure type.

Example inventory/dev:

[dev]
github-dev.someplace.edu:122

Example group_vars/dev:

---
ghe:
  sign_in_check_string: Sign in to your account
  #upgrade_package_url: https://github-enterprise.s3.amazonaws.com/esx/updates/github-enterprise-esx-2.7.1.pkg
  #force_upgrade_to_latest: true
  #validate_cert: true
zenoss_uid: /zport/dmd/Devices/Server/Linux/devices/github-dev.someplace.edu
vm_name: changeme
  • ghe.sign_in_check_string - The string to search for when checking if the application has successfully come back up after an upgrade. For deployments using the default GitHub authentication, the value should be 'Sign in to your account' as shown in the example.
  • ghe.force_upgrade_to_latest (optional) - Force ghe-update-check to ignore the current release series in favor of the latest version available.
  • ghe.upgrade_package_url (optional) - Force the playbook to download and run the specified upgrade package file. Hotpatch package files are also supported. This option overrides ghe.force_upgrade_to_latest and should only be used to install a specific version.
  • ghe.validate_cert (optional) - Set to false to skip SSL certificate validation when checking if the application has successfully come back up after an upgrade. Not recommended unless you really need this!
  • zenoss_uid (optional) - Zenoss device uid for managing maintenance state
  • vm_name (optional) - VMware VM name that is running GitHub Enterprise

If zenoss_uid and vm_name config options are defined, group_vars/all must contain the configuration for Zenoss and VMware that will apply across all infrastructure types:

---
zenoss:
    hostname: '{{ lookup("env", "ZENOSS_HOSTNAME") }}'
    user: '{{ lookup("env", "ZENOSS_USERNAME") }}'
    password: '{{ lookup("env", "ZENOSS_PASSWORD") }}'
vmware:
    hostname: '{{ lookup("env", "VCENTER_HOSTNAME") }}'
    user: '{{ lookup("env", "VCENTER_USERNAME") }}'
    password: '{{ lookup("env", "VCENTER_PASSWORD") }}'
    skip_certcheck: false

You are strongly encouraged to use environment variables to provide credentials!

Upgrading GitHub Enterprise

ansible-playbook -i inventory/dev upgrade_ghe.yml

ansible-github-enterprise's People

Contributors

stacybrock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible-github-enterprise's Issues

Check for configuration run in progress

Upgrades to 2.14 fail with the following error:

TASK [upgrade-ghe : disable maintenance mode in GHE] ***************************
fatal: [github-stage.someplace.edu]: FAILED! => {"changed": false, "cmd": ["ghe-maintenance", "-u"], "delta": "0:00:00.096351", "end": "2018-07-12 17:29:12.469892", "msg": "non-zero return code", "rc": 1, "start": "2018-07-12 17:29:12.373541", "stderr": "", "stderr_lines": [], "stdout": "A configuration run is currently in progress. Unable to unset maintenance mode. Please try again after the configuration run is completed.", "stdout_lines": ["A configuration run is currently in progress. Unable to unset maintenance mode. Please try again after the configuration run is completed."]}
	to retry, use: --limit @/opt/ansible/ansible-github-enterprise/upgrade_ghe.retry

Add a check before this task that determines if the configuration run is complete or not before proceeding.

Parameterize zenoss and vmware steps

This playbook currently updates maintenance status in Zenoss and takes a snapshot of the VM in VMware whether one needs it or not. It would be nice to pull those steps out and make them optional for those who don't use Zenoss or VMware in their infrastructures.

Warnings thrown when running playbook with ansible 2.3.x

A few warnings are now being thrown when running this playbook in ansible 2.3.x.

TASK [upgrade-ghe : verify ghe-update-check results] ***************************
 [WARNING]: when statements should not include jinja2 templating delimiters
TASK [upgrade-ghe : set maintenance state in zenoss] ***************************
 [WARNING]: Module did not set no_log for password

etc.

Whatever ansible is complaining about here should probably be fixed.

Add support for GitHub Enterprise 2.21 ghe-upgrade-check changes

In GitHub Enterprise 2.21, the ghe-upgrade-check command now returns two different strings depending on if the -i flag is given. This causes the current playbook to handle the version check incorrectly and attempt to upgrade even if GHE is already running the latest version.

Remove root environment workaround

The issue where ghe-update-check did not honor the system proxy setting was fixed in 2.6.4, so the workaround that preserved the root environment via a modified version of the script (ghe-update-check-OSU) can be removed.

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.