Skip to content

Commit

Permalink
Merge pull request #78 from appsembler/reconfiguration-command
Browse files Browse the repository at this point in the history
Add reconfigure script
  • Loading branch information
iamjazzar authored Sep 15, 2021
2 parents 048f26a + cc06aa8 commit 8880275
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/devstack/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
requirements: "{{ working_directory }}/devstack/requirements/base.txt"
virtualenv: "{{ working_directory }}/env"
virtualenv_python: python3
become: false
become: no
tags: [ devstack, env ]

- name: Change '{{ working_directory }}' owner
Expand Down
5 changes: 5 additions & 0 deletions extras/sultan-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ _main_instance ()
COMPREPLY=()
return
;;
reconfigure)
COMPREPLY=()
return
;;
restart)
COMPREPLY=()
return
Expand Down Expand Up @@ -382,6 +386,7 @@ _main_instance ()
ip
ping
provision
reconfigure
restart
restrict
run
Expand Down
11 changes: 9 additions & 2 deletions scripts/instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ${BOLD}${GREEN}instance${NORMAL}
start Starts your stopped virtual machine on GCP.
stop Stops your virtual machine on GCP, but doesn't delete it.
restart Restarts your virtual machine on GCP.
reconfigure Reconfigures your instance.
describe Describes your virtual machine instance.
status Shows the status of your running machine.
setup Setup a restricted instance for you on GCP contains a
Expand Down Expand Up @@ -253,7 +254,14 @@ _image_setup() {

$sultan local hosts config
$sultan local ssh config
$sultan instance reconfigure

success "Your instance has been successfully created!" "From $IMAGE_NAME"
message "Run ${BOLD}${CYAN}sultan devstack up${NORMAL}${MAGENTA} to start devstack servers."
}


reconfigure() {
message "Personalizing your instance..."
# shellcheck disable=SC1090
ansible-playbook "$sultan_dir"/ansible/devstack.yml \
Expand All @@ -271,8 +279,7 @@ _image_setup() {
user=$USER_NAME
working_directory=$DEVSTACK_WORKSPACE" &> "$SHELL_OUTPUT"

success "Your instance has been successfully created!" "From $IMAGE_NAME"
message "Run ${BOLD}${CYAN}sultan devstack up${NORMAL}${MAGENTA} to start devstack servers."
success "Your instance has been reconfigured successfully"
}

describe() {
Expand Down

0 comments on commit 8880275

Please sign in to comment.