Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #514 from AlanCoding/data_gen
Browse files Browse the repository at this point in the history
Make fake data script work with login command
  • Loading branch information
AlanCoding authored Apr 25, 2018
2 parents cec8413 + 0fe39da commit 3ac701b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/source/cli_ref/examples/fake_data_creator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ echo "Tower-CLI DATA FAKER: reading config settings"
hostval=$(tower-cli config host)
USER_OUTPUT=$(tower-cli config username)
userval=$(echo $USER_OUTPUT| cut -d' ' -f 2)
passwordval=$(tower-cli config password)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [[ $userval == "username: " ]] || [[ $passwordval == "password: " ]]
if [[ $userval == "username: " ]]
then
echo "WARNING: Configuration has not been fully set";
echo " You will want to run the $ tower-cli config ";
Expand Down Expand Up @@ -108,13 +107,13 @@ ssh_key_data: |

echo "Tower-CLI DATA FAKER: creating credentials"
# Example credentials for cloud and machine
tower-cli credential create --name="SSH example" --user=$userval --inputs="$machine_cred_inputs" --credential-type="Machine"
tower-cli credential create --name="blank SSH" --user=$userval --inputs="{}" --credential-type="Machine"
tower-cli credential create --name="vault password" --user=$userval --inputs="vault_password: password" --credential-type="Vault"
tower-cli credential create --name="SSH example" --organization="Default" --inputs="$machine_cred_inputs" --credential-type="Machine"
tower-cli credential create --name="blank SSH" --organization="Default" --inputs="{}" --credential-type="Machine"
tower-cli credential create --name="vault password" --organization="Default" --inputs="vault_password: password" --credential-type="Vault"
tower-cli credential create --name="AWS creds" --team=Ops --credential-type="Amazon Web Services" --inputs='{"username": "your_username", "password": "password"}'
# Two users who can become the other to escalate a task
tower-cli credential create --credential-type="Machine" --name=user1 --inputs='{"username": "user1", "password": "pass1", "become_method": "su", "become_username": "user2"}' --user=$userval
tower-cli credential create --credential-type="Machine" --name=user2 --inputs='{"username": "user2", "password": "pass1", "become_method": "su", "become_username": "user1"}' --user=$userval
tower-cli credential create --credential-type="Machine" --name=user1 --inputs='{"username": "user1", "password": "pass1", "become_method": "su", "become_username": "user2"}' --organization="Default"
tower-cli credential create --credential-type="Machine" --name=user2 --inputs='{"username": "user2", "password": "pass1", "become_method": "su", "become_username": "user1"}' --organization="Default"

echo "Tower-CLI DATA FAKER: creating inventories and groups"
# Basic localhost examples
Expand Down

0 comments on commit 3ac701b

Please sign in to comment.