Coder Social home page Coder Social logo

awx-migrate's Introduction

Welcome to Autops awx-migrate

awx-migrate is a command line tool for Ansible AWX. It leverages the tower-cli command, makes a full backup of an AWX instance, and adds the secrets to the exported credentials, which tower-cli leaves empty.

It then dumps the whole export including credential secrets in json to stdout, which you can redirect to a file. It also takes al config settings from the database - including LDAP settings and adds or updates them in a new instance.

This tool allows you to fully migrate an AWX setup, and is a workaround for not being able to upgrade AWX. (See https://github.com/ansible/awx/blob/devel/DATA_MIGRATION.md)

For more information, on tower-cli look at http://tower-cli.readthedocs.io.

Things that are not migrated

  • logs
  • encrypted data in the conf_setting table (e.g. LDAP Bind password)

Requirements

Python

  • Python 2.7
  • tower_cli
  • psycopg2
  • cryptography

Configuration

AWX - separately configure how to connect to both the old and the new instance

  • The AWX secret_key, used to encrypt and decrypt secrets
  • credentials for an AWX admin user
  • connection information and credentials to directly access the postgresql DB

and this for both the source and destination AWX instance and its postgresql database

How-to

  • edit awx-migrate-wrapper and set the right AWX_SRC_* and AWX_DST_* environment variables as needed, the former being for the source instance, the latter for the destination instance
  • configure tower-cli config to connect to the source awx instance you want to migrate from
  • execute awx-migrate-wrapper and it will redirect stdout to awx-data.json, then split each asset_type in different files so you can restore them seperately and in the best possible way.
  • watch stderr for possible error messages
  • if you use LDAP or other config settings that require an encrypted secret, update it manually
  • configure tower-cli config to connect to the destination awx instance you want to migrate to
  • restore awx data with tower-cli send awx-data.json

Bugs

  • Tested migrating from AWX 1.0.7.2 to 2.0.1. Several objects where not restored due to missing users: there's bug in 1.0.x? where the export of users is broken/missing so that tower-cli cannot import them again. (see ansible/tower-cli#586 (comment))
  • Currently this script assumes all credentials have a unique name, which however isn't enforced by AWX. If you have those, PR is welcome!
  • Encrypted secrets in the conf_settings table are not decrypted. Need info on how to decrypt/encrypt them

Warning

This script was written for and tested in a specific setup and particular environment, lot's of issues or bugs can still arise

awx-migrate's People

Contributors

srgvg avatar mogiepete avatar bmillemathias avatar jpmens avatar paihu avatar

Watchers

James Cloos 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.