-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding GH action for increasing disk space of an EC2 instance (#148)
* adding GH action for increasing disk space of an EC2 instance * pull ansible hosts file from S3
- Loading branch information
1 parent
91c92b1
commit 8b1b524
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Increase Node Disk | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
network: | ||
type: environment | ||
description: "Whether updating a testnet or mainnet node" | ||
required: true | ||
aws_region: | ||
description: "Location of EC2 instance to modify" | ||
required: true | ||
instance_name: | ||
description: "The name of the EC2 instance" | ||
required: true | ||
disk_size: | ||
description: "The total size of the disk desired" | ||
required: true | ||
|
||
|
||
jobs: | ||
increase-disk: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Hosts Config | ||
id: get-hosts | ||
uses: keithweaver/[email protected] | ||
with: | ||
command: cp | ||
source: ${{env.S3_ANSIBLE_HOST_FILE}} | ||
destination: ./ansible-hosts | ||
aws_access_key_id: ${{ github.env.secret.AWS_ACCESS_KEY_ID }} | ||
aws_secret_access_key: ${{ github.env.secret.AWS_SECRET_KEY }} | ||
aws_region: ${{env.S3_REGION}} | ||
|
||
- name: Run playbook | ||
uses: dawidd6/[email protected] | ||
with: | ||
# Required, playbook filepath | ||
playbook: ec2-set-volume-size.yml | ||
# Optional, directory where playbooks live | ||
directory: ./scripts/ansible/aws | ||
# Optional, additional flags to pass to ansible-playbook | ||
options: | | ||
--inventory ./ansible-hosts | ||
--extra-vars aws_region="${{github.event.inputs.aws_region}}" aws_secret_key="${{github.env.secret.AWS_SECRET_KEY}}" aws_access_key_id="${{github.env.secret.AWS_ACCESS_KEY_ID}}" name="${{github.event.inputs.instance_name}}" volume_size="${{github.event.inputs.disk_size}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters