Commit Graph

112 Commits

Author SHA1 Message Date
Ryan Petrello
b8e0c91bd4 store stderr on successful inventory syncs
see: #4823
2017-06-21 10:20:50 -04:00
AlanCoding
890b5bba58 SCM Inventory task system and variables stability edits
* Ensure "fresh bits" in dependent jobs
  - run IUs in same context and dependent PU
  - review docs for update-on-launch expectations
* Avoid customer variable precedence upgrade issues
  - only allow SCM types to have overwrite_vars=true
  - do not run other cloud sources through the backported script
* Make extra sure to echo stdout and stderr in event of error
2017-05-08 09:43:11 -04:00
AlanCoding
2f62182940 refactor inventory Loaders for ansible-inventory
* remove support for loading from executable and static files
* instead use ansible-inventory with fallback to backport
* provide private file dir in task manager for cred injection
* durable management of tmp dirs for user scripts

* new 'scm' source choice for scm-type
* update SCM inventory docs to new reality
2017-05-01 14:37:43 -04:00
AlanCoding
8e6020436c modularization of inventory_import command
This separates file parsing logic that was mixed
in with other important code inside of the
inventory import command.

The logic around MemObject data structures was
moved to utils, and the file parsing was moved
to a legacy module. As of this commit, that
module can operate within the Tower environment
but it will be removed.

Also refactor the loggers to fix old bug and
work inside of the different contexts - the
Loader classes, mem objects, and hopefully
the inventory modules eventually.
2017-05-01 14:37:42 -04:00
AlanCoding
0aab8b6713 Port basic inventory_import command tests over to new system 2017-04-12 11:16:35 -04:00
AlanCoding
a2ffbafea8 Update inventory_update to group-less inventory sources 2017-04-12 10:10:16 -04:00
AlanCoding
69527fdb08 unicode conversion of paths in inventory import 2017-01-09 15:10:02 -05:00
Chris Meyers
46049877a5 Merge pull request #4513 from chrismeyersfsu/fix-4362
only print dep warn for rax
2016-12-19 17:20:41 -05:00
Chris Meyers
4e71690bf3 only print dep warn for rax 2016-12-19 16:55:57 -05:00
Chris Meyers
b72a148cbc vmware_inventory dyn inv script support 2016-12-19 16:39:10 -05:00
Chris Meyers
a95880b60a fix license not found err msg 2016-12-19 10:39:28 -05:00
Chris Meyers
5d9d332792 rackspace deprecation warning on inv update 2016-12-16 10:36:38 -05:00
Chris Church
6ebe45b1bd Configure Tower in Tower:
* Add separate Django app for configuration: awx.conf.
* Migrate from existing main.TowerSettings model to conf.Setting.
* Add settings wrapper to allow get/set/del via django.conf.settings.
* Update existing references to tower_settings to use django.conf.settings.
* Add a settings registry to allow for each Django app to register configurable settings.
* Support setting validation and conversion using Django REST Framework fields.
* Add /api/v1/settings/ to display a list of setting categories.
* Add /api/v1/settings/<slug>/ to display all settings in a category as a single object.
* Allow PUT/PATCH to update setting singleton, DELETE to reset to defaults.
* Add "all" category to display all settings across categories.
* Add "changed" category to display only settings configured in the database.
* Support per-user settings via "user" category (/api/v1/settings/user/).
* Support defaults for user settings via "user-defaults" category (/api/v1/settings/user-defaults/).
* Update serializer metadata to support category, category_slug and placeholder on OPTIONS responses.
* Update serializer metadata to handle child fields of a list/dict.
* Hide raw data form in browsable API for OPTIONS and DELETE.
* Combine existing licensing code into single "TaskEnhancer" class.
* Move license helper functions from awx.api.license into awx.conf.license.
* Update /api/v1/config/ to read/verify/update license using TaskEnhancer and settings wrapper.
* Add support for caching settings accessed via settings wrapper.
* Invalidate cached settings when Setting model changes or is deleted.
* Preload all database settings into cache on first access via settings wrapper.
* Add support for read-only settings than can update their value depending on other settings.
* Use setting_changed signal whenever a setting changes.
* Register configurable authentication, jobs, system and ui settings.
* Register configurable LDAP, RADIUS and social auth settings.
* Add custom fields and validators for URL, LDAP, RADIUS and social auth settings.
* Rewrite existing validator for Credential ssh_private_key to support validating private keys, certs or combinations of both.
* Get all unit/functional tests working with above changes.
* Add "migrate_to_database_settings" command to determine settings to be migrated into the database and comment them out when set in Python settings files.
* Add support for migrating license key from file to database.
* Remove database-configuable settings from local_settings.py example files.
* Update setup role to no longer install files for database-configurable settings.

f 94ff6ee More settings work.
f af4c4e0 Even more db settings stuff.
f 96ea9c0 More settings, attempt at singleton serializer for settings.
f 937c760 More work on singleton/category views in API, add code to comment out settings in Python files, work on command to migrate settings to database.
f 425b0d3 Minor fixes for sprint demo.
f ea402a4 Add support for read-only settings, cleanup license engine, get license support working with DB settings.
f ec289e4 Rename migration, minor fixmes, update setup role.
f 603640b Rewrite key/cert validator, finish adding social auth fields, hook up signals for setting_changed, use None to imply a setting is not set.
f 67d1b5a Get functional/unit tests passing.
f 2919b62 Flake8 fixes.
f e62f421 Add redbaron to requirements, get file to database migration working (except for license).
f c564508 Add support for migrating license file.
f 982f767 Add support for regex in social map fields.
2016-09-26 22:14:47 -04:00
James Laska
08c4c9647b Resolve KeyError by coercing instance_id to a str
Related #3300
2016-08-19 15:37:28 -04:00
James Laska
11d68d1ebe Complete Sat6 integration
Various fixes to get sat-6 integration working.

* inventory_import.py - the inventory script is called foreman.py
* tasks.py - be sure to call `add_section()` before using it
* defaults.py - Add various SATELLITE6_* enablement variables

Relates #3119
2016-07-25 15:13:39 -04:00
Akita Noek
b57739a800 Converted except T,e expressions to except T as e 2016-06-27 15:12:37 -04:00
Matthew Jones
8e5f502d00 Use ansible venv to be used during inv import 2016-06-14 15:21:09 -04:00
Matthew Jones
bdf5ee1fea Import latest ec2.py and fix an issue
Upgrading ec2.py to fix an issue where the module wasn't obeying
"replace_dash_in_groups" property.
2016-06-07 14:01:00 -04:00
Matthew Jones
76ce77aaf7 Remove stray inventory source debug statement 2016-05-04 13:18:50 -04:00
Matthew Jones
39f922d2fe Fix up azure source identification logic
We now need to deal with two azure inventory scripts.  The logic here
was incorrect after the PR importing the new module.   This brings it
back in line with the old logic for selecting the class azure inventory script.
2016-05-04 13:17:19 -04:00
Matthew Jones
296f70ce17 Implement Azure RM creds and inventory
* Vendor ansible's azure_rm inventory script
* Add new inventory type
* Add new credential type
* Expand host instance_id column from varchar 100 to 1024 to accept the
  long instance ids returned by Azure
* Make the inventory_import azure match rename more explicit.
2016-04-21 13:51:30 -04:00
Akita Noek
25f0d65c5f Ancestor rebuild optimization progress 2016-04-14 21:56:10 -04:00
Akita Noek
dde2e66a2f Fix missing .all() from active flag filter nuke 2016-03-22 15:36:07 -04:00
Akita Noek
6ea99583da Mass active flag code removal 2016-03-15 09:29:55 -04:00
Akita Noek
ba833d683e Active flag removal: switched from using mark_inactive to delete calls 2016-03-15 09:29:28 -04:00
Chris Church
60224cdbe4 Update Django to 1.8 and DRF to 3.3, add new Django migrations, update serializers/pagination/metadata, update browsable API styling. 2016-02-02 17:48:04 -05:00
Matthew Jones
769fe18724 Wrap up other places where the old license access method is used 2016-01-25 20:59:18 -05:00
Matthew Jones
35b19bf220 Update settings references
* PROOT
* Pendo tracking state
* ad hoc commands
* activity stream
* org admin visibility
2015-12-15 16:44:08 -05:00
Matthew Jones
6e2efd3f8a Overwrite should not imply overwrite-vars 2015-10-12 13:07:50 -04:00
Chris Meyers
d2a555b752 non-celery invocations (command-line invocations) do not update the inventory_update object after completion 2015-06-17 12:36:07 -04:00
Chris Meyers
fcc789f13b Differentiate between an expired license and a non-existant license 2015-06-16 15:59:23 -04:00
Chris Church
4607972135 Included openstack inventory script from core + changes from some open PRs, fixes to be able to use without custom changes for tower. 2015-06-12 00:58:33 -04:00
John Mitchell
32d1c0e4db fixed copyright date 2015-06-11 16:10:23 -04:00
Matthew Jones
b3da3b34a3 Changing some legal headers for python source files 2015-05-29 12:10:39 -04:00
Chris Church
7f1c97b167 Include pk in inventory source name to keep it unique even with group renames. Fixes https://trello.com/c/PnmDWCai 2015-05-20 14:00:33 -04:00
Chris Meyers
1df51f3c48 better error handling 2015-04-20 17:15:03 -04:00
Matthew Jones
f4d960b127 Fix an issue where going from having 1 or more hosts to having 0 hosts
could trigger an inventory sync failure
2015-03-27 13:25:16 -04:00
Matthew Jones
6a18a50d99 Fixing flake8 errors, this should be almost all of them! 2015-02-11 16:42:55 -05:00
Matthew Jones
1d76c1cd06 More pep8 goodness 2015-02-04 14:44:38 -05:00
Chris Meyers
cfb56c25a0 inventory_import behave more like ansible
```
mkdir inv
echo foo > inv/hosts
mkdir inv/host_vars
touch inv/host_vars/foo
touch inv/host_vars/foo.yml
```

```
ansible -i ./inv -c local -m ping all
```

```
tower-mange inventory_import --inventory-id=1 ./inv
```

The tower command above now throws an error similar to ansible:

`Multiple variable files found. There should only be one.`
2015-01-27 14:56:03 -05:00
Matthew Jones
eaee8d76c4 Fix a bug launching a custom inventory script under proot where we would
never actually launch the job under proot
2014-12-15 10:42:22 -05:00
Matthew Jones
ec887f877f Support running custom inventory scripts (only) from within proot if enabled 2014-12-05 15:25:06 -05:00
Chris Church
fcf7398ec6 Add common code for determining active (licensed) hosts with unique names, update licensing code and inventory import to use it. Implements https://trello.com/c/2Q9Mosks 2014-12-03 19:41:01 -05:00
Chris Church
6b91f46082 Log warning and continue on invalid port specification. Fixes traceback from https://trello.com/c/0OgJ3uRb 2014-12-03 19:27:52 -05:00
Matthew Jones
9064bb3107 Fix a bug where we could potentially not see a hostname that we need to
update instead of create when syncing inventory because its instance id
had changed
2014-09-24 13:35:04 -04:00
Chris Church
5fe3ee3bf4 Fixes https://trello.com/c/ZBHrkuLb - Add support for IPv6 addresses in inventory import. 2014-09-12 02:34:07 -04:00
Luke Sneeringer
3267a988f8 Shift Django to 1.6.x (>= 1.6.7). 2014-09-10 12:17:35 -05:00
Matthew Jones
7badbca045 Fix license exceeded message 2014-08-18 13:38:22 -04:00
Chris Church
578f4b9c3b Fix inventory import to look for group and host vars files with .yml, .yaml and .json extensions in addition to no extension. 2014-08-12 22:58:11 -04:00
Chris Church
d6b3e3079a Disable extra actions on save for inventory sources when running inventory import. 2014-08-11 11:41:40 -04:00