From b8b54964d1e6b4ba4b6eef0fb34aa857282e0b50 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Wed, 28 Feb 2024 15:07:47 -0500 Subject: [PATCH 01/31] wait for ebs volume modification to end --- .github/workflows/node-increase-disk.yml | 13 +++++++++++-- scripts/ansible/aws/ec2-modify-volume-size.yml | 13 +++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 207e11d70..fe12b3e5b 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -61,12 +61,21 @@ jobs: parameters: | {"commands":["sudo growpart /dev/nvme0n1 1", "sudo resize2fs /dev/nvme0n1p1"]} - - name: Check SSM output + - name: Get SSM output + id: get-ssm-output if: steps.extend-file-system.outcome == 'success' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} AWS_DEFAULT_REGION: ${{ inputs.aws_region }} run: | - aws ssm list-command-invocations --command-id "${{ steps.extend-file-system.outputs.command-id }}" --details + echo "COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id "${{ steps.extend-file-system.outputs.command-id }}" --details)" >> $GITHUB_ENV + + - name: Check SSM output + if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') + run: | + echo "Error detected trying to extend the partition." + echo ${{env.COMMAND_OUTPUT}} + exit 1 + diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 717f08b47..5d1ed811a 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -51,4 +51,17 @@ volume_type: "{{ volume_type_default }}" iops: "{{ iops | default(1300) if volume_type_default is regex('^io*') else omit }}" modify_volume: true + + - name: Wait for volume modification to complete + delegate_to: 127.0.0.1 + become: no + command: aws --region "{{ ansible_ec2_placement_region }}" ec2 describe-volumes-modifications --volume-id "{{ vol_id }}" --output json + register: result + until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 + retries: 60 + delay: 5 + changed_when: False + when: + - not ansible_check_mode + - vol_new_size > vol_size | int From 23bffcef5c94209e9ff25655a1dbab1117d438ca Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Wed, 28 Feb 2024 15:14:37 -0500 Subject: [PATCH 02/31] fix yaml formatting --- .../ansible/aws/ec2-modify-volume-size.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 5d1ed811a..71d76a9e1 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -52,16 +52,16 @@ iops: "{{ iops | default(1300) if volume_type_default is regex('^io*') else omit }}" modify_volume: true - - name: Wait for volume modification to complete - delegate_to: 127.0.0.1 - become: no - command: aws --region "{{ ansible_ec2_placement_region }}" ec2 describe-volumes-modifications --volume-id "{{ vol_id }}" --output json - register: result - until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 - retries: 60 - delay: 5 - changed_when: False - when: - - not ansible_check_mode - - vol_new_size > vol_size | int + - name: Wait for volume modification to complete + delegate_to: 127.0.0.1 + become: no + command: aws --region "{{ ansible_ec2_placement_region }}" ec2 describe-volumes-modifications --volume-id "{{ vol_id }}" --output json + register: result + until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 + retries: 60 + delay: 5 + changed_when: False + when: + - not ansible_check_mode + - vol_new_size > vol_size | int From 73126de006f58bdc5d46154e234da9d08d913837 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Wed, 28 Feb 2024 15:32:00 -0500 Subject: [PATCH 03/31] remove check --- scripts/ansible/aws/ec2-modify-volume-size.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 71d76a9e1..d99501a7b 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -63,5 +63,4 @@ changed_when: False when: - not ansible_check_mode - - vol_new_size > vol_size | int From 32ff9bd88909df93a0727ec9a2c5f48d8f263813 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Wed, 28 Feb 2024 16:24:57 -0500 Subject: [PATCH 04/31] fix var names in new code --- scripts/ansible/aws/ec2-modify-volume-size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index d99501a7b..c44871c77 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -55,7 +55,7 @@ - name: Wait for volume modification to complete delegate_to: 127.0.0.1 become: no - command: aws --region "{{ ansible_ec2_placement_region }}" ec2 describe-volumes-modifications --volume-id "{{ vol_id }}" --output json + command: aws --region "{{ aws_region }}" ec2 describe-volumes-modifications --volume-id "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" --output json register: result until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 retries: 60 From 1d305b4468ac9f556c36bff9a98638810d7342cc Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Mon, 1 Apr 2024 13:54:40 -0400 Subject: [PATCH 05/31] increase delay on volume modification check --- scripts/ansible/aws/ec2-modify-volume-size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index c44871c77..a9ef74442 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -59,7 +59,7 @@ register: result until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 retries: 60 - delay: 5 + delay: 30 changed_when: False when: - not ansible_check_mode From b56d23ef5c01a6021e6265affc9ae8c9aebaacd3 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Wed, 3 Apr 2024 15:44:12 -0400 Subject: [PATCH 06/31] increase ansible verbosity --- .github/workflows/node-increase-disk.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index fe12b3e5b..6d7161e35 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -46,6 +46,7 @@ jobs: playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml inventory: ./ansible-hosts galaxy_file: ./scripts/ansible/aws/requirements.yml + verbose: 3 extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" - name: Extend file system From 986fbe05d525b3c2b1c61794dd3f33c29d6abc1b Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Thu, 18 Apr 2024 14:18:50 -0400 Subject: [PATCH 07/31] make delay 5 minutes --- scripts/ansible/aws/ec2-modify-volume-size.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index a9ef74442..2c573e054 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -58,8 +58,8 @@ command: aws --region "{{ aws_region }}" ec2 describe-volumes-modifications --volume-id "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" --output json register: result until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 - retries: 60 - delay: 30 + retries: 6 + delay: 300 changed_when: False when: - not ansible_check_mode From d85d8d26ab7678d45b1e1ed60824eec8b371a74a Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Thu, 18 Apr 2024 15:44:01 -0400 Subject: [PATCH 08/31] switch to simple sleep --- .github/workflows/node-increase-disk.yml | 4 ++++ scripts/ansible/aws/ec2-modify-volume-size.yml | 11 ----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 6d7161e35..0c475bd6d 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -49,6 +49,10 @@ jobs: verbose: 3 extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + - name: Wait for AWS to finish provisioning the disk + run: sleep 30m + shell: bash + - name: Extend file system id: extend-file-system uses: nohmad/aws-ssm-send-command-action@master diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 2c573e054..6c9cbe326 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -52,15 +52,4 @@ iops: "{{ iops | default(1300) if volume_type_default is regex('^io*') else omit }}" modify_volume: true - - name: Wait for volume modification to complete - delegate_to: 127.0.0.1 - become: no - command: aws --region "{{ aws_region }}" ec2 describe-volumes-modifications --volume-id "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" --output json - register: result - until: result.stdout.find('completed') != -1 or result.stdout.find('optimizing') != -1 - retries: 6 - delay: 300 - changed_when: False - when: - - not ansible_check_mode From 12f923161c81973693b126f123bae6a3afac98fe Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Tue, 23 Apr 2024 17:51:17 -0400 Subject: [PATCH 09/31] tweak ssm output command --- .github/workflows/node-increase-disk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 0c475bd6d..c6a4a31df 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -74,7 +74,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} AWS_DEFAULT_REGION: ${{ inputs.aws_region }} run: | - echo "COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id "${{ steps.extend-file-system.outputs.command-id }}" --details)" >> $GITHUB_ENV + echo "COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details)" >> $GITHUB_ENV - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') From 9fdbf203a6d8a93c18b9a0b4ba2cb66f52d4d13e Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Fri, 7 Feb 2025 14:09:48 -0500 Subject: [PATCH 10/31] attempt to fix SSM output check using jq --- .github/workflows/node-increase-disk.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index c6a4a31df..505723001 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -25,6 +25,9 @@ jobs: environment: ${{inputs.network}} runs-on: ubuntu-latest steps: + - name: Install jq + run: sudo apt-get install -y jq + - name: Checkout uses: actions/checkout@v4 @@ -74,7 +77,8 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} AWS_DEFAULT_REGION: ${{ inputs.aws_region }} run: | - echo "COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details)" >> $GITHUB_ENV + COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details | jq -c .) + echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') From c9ad15d59a9d563dcc47103442d13f5c8b77508d Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:23:31 +0300 Subject: [PATCH 11/31] Fix action palybook branch. --- .github/workflows/node-increase-disk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 505723001..3ec570f68 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -43,7 +43,7 @@ jobs: aws_region: ${{vars.S3_REGION}} - name: Run playbook - uses: arillso/action.playbook@master + uses: arillso/action.playbook@main with: # Required, playbook filepath playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml From 034912e6063c74cf89f522cffc6bd4d965271d30 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 9 Sep 2025 14:53:44 +0300 Subject: [PATCH 12/31] temp: disable playbook for size increase. --- .github/workflows/node-increase-disk.yml | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 3ec570f68..d088ebc2d 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -31,30 +31,30 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Get Hosts Config - id: get-hosts - uses: keithweaver/aws-s3-github-action@v1.0.0 - with: - command: cp - source: ${{vars.S3_ANSIBLE_HOST_FILE}} - destination: ./ansible-hosts - aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} - aws_region: ${{vars.S3_REGION}} + # - name: Get Hosts Config + # id: get-hosts + # uses: keithweaver/aws-s3-github-action@v1.0.0 + # with: + # command: cp + # source: ${{vars.S3_ANSIBLE_HOST_FILE}} + # destination: ./ansible-hosts + # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} + # aws_region: ${{vars.S3_REGION}} - - name: Run playbook - uses: arillso/action.playbook@main - with: - # Required, playbook filepath - playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml - inventory: ./ansible-hosts - galaxy_file: ./scripts/ansible/aws/requirements.yml - verbose: 3 - extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + # - name: Run playbook + # uses: arillso/action.playbook@main + # with: + # # Required, playbook filepath + # playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml + # inventory: ./ansible-hosts + # galaxy_file: ./scripts/ansible/aws/requirements.yml + # verbose: 3 + # extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" - - name: Wait for AWS to finish provisioning the disk - run: sleep 30m - shell: bash + # - name: Wait for AWS to finish provisioning the disk + # run: sleep 30m + # shell: bash - name: Extend file system id: extend-file-system From c1cb3a62064d363a774962eb94321a26c10a76ca Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 9 Sep 2025 15:06:19 +0300 Subject: [PATCH 13/31] temp: add smm healthcheck. --- .github/workflows/node-increase-disk.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index d088ebc2d..08945fde5 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -56,6 +56,18 @@ jobs: # run: sleep 30m # shell: bash + - name: SSM smoke test + uses: nohmad/aws-ssm-send-command-action@master + with: + aws-region: ${{ inputs.aws_region }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + targets: | + [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] + document-name: AWS-RunShellScript + parameters: | + {"commands":["echo SSM_OK && df -h / || true"]} + - name: Extend file system id: extend-file-system uses: nohmad/aws-ssm-send-command-action@master From 296ea9648d36df33e35c07d49670e54db11ce268 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 9 Sep 2025 15:45:18 +0300 Subject: [PATCH 14/31] Revert temps. --- .github/workflows/node-increase-disk.yml | 56 ++++++++++-------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 08945fde5..3ec570f68 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -31,42 +31,30 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # - name: Get Hosts Config - # id: get-hosts - # uses: keithweaver/aws-s3-github-action@v1.0.0 - # with: - # command: cp - # source: ${{vars.S3_ANSIBLE_HOST_FILE}} - # destination: ./ansible-hosts - # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} - # aws_region: ${{vars.S3_REGION}} - - # - name: Run playbook - # uses: arillso/action.playbook@main - # with: - # # Required, playbook filepath - # playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml - # inventory: ./ansible-hosts - # galaxy_file: ./scripts/ansible/aws/requirements.yml - # verbose: 3 - # extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" - - # - name: Wait for AWS to finish provisioning the disk - # run: sleep 30m - # shell: bash + - name: Get Hosts Config + id: get-hosts + uses: keithweaver/aws-s3-github-action@v1.0.0 + with: + command: cp + source: ${{vars.S3_ANSIBLE_HOST_FILE}} + destination: ./ansible-hosts + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} + aws_region: ${{vars.S3_REGION}} - - name: SSM smoke test - uses: nohmad/aws-ssm-send-command-action@master + - name: Run playbook + uses: arillso/action.playbook@main with: - aws-region: ${{ inputs.aws_region }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} - targets: | - [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] - document-name: AWS-RunShellScript - parameters: | - {"commands":["echo SSM_OK && df -h / || true"]} + # Required, playbook filepath + playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml + inventory: ./ansible-hosts + galaxy_file: ./scripts/ansible/aws/requirements.yml + verbose: 3 + extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + + - name: Wait for AWS to finish provisioning the disk + run: sleep 30m + shell: bash - name: Extend file system id: extend-file-system From e5fac849fb92cc28d7b4649d52455a0f4d7a7ca7 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:24:37 +0200 Subject: [PATCH 15/31] Fix missing packaging python. --- scripts/ansible/aws/ec2-modify-volume-size.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 6c9cbe326..a7c039c4e 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -6,6 +6,10 @@ volume_type_default: "{{ volume_type | default('io1') }}" pre_tasks: + + - name: Install packaging so Ansible's pip module can run + ansible.builtin.command: /usr/bin/python3 -m pip install --upgrade pip setuptools wheel packaging + - name: Install dependencies pip: name={{ item }} with_items: From e85e6af9903c6d070e35915b599387b7a9a14c7e Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:33:03 +0200 Subject: [PATCH 16/31] Fix missing packaging python. --- .../ansible/aws/ec2-modify-volume-size.yml | 90 +++++++++---------- 1 file changed, 43 insertions(+), 47 deletions(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index a7c039c4e..a740f199c 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -4,56 +4,52 @@ vars: instance_name: "{{ name }} (created by ansible)" volume_type_default: "{{ volume_type | default('io1') }}" + ansible_python_interpreter: /usr/bin/python3 pre_tasks: - - - name: Install packaging so Ansible's pip module can run - ansible.builtin.command: /usr/bin/python3 -m pip install --upgrade pip setuptools wheel packaging - - - name: Install dependencies - pip: name={{ item }} - with_items: - - boto3 - - botocore + - name: Install dependencies + pip: name={{ item }} + with_items: + - boto3 + - botocore tasks: - - - name: Get EC2 instance state - amazon.aws.ec2_instance: - aws_access_key_id: "{{ aws_access_key_id }}" - aws_secret_access_key: "{{ aws_secret_key }}" - region: "{{ aws_region }}" - instance_ids: [ "{{instance_id}}" ] - register: instances - - - name: EC2 instance info - ansible.builtin.debug: - msg: Instance ID {{ instances['instances'][0].instance_id }}, root volume {{ instances['instances'][0].block_device_mappings[0].ebs }} - - - name: Get current volume info - amazon.aws.ec2_vol: - aws_access_key_id: "{{ aws_access_key_id }}" - aws_secret_access_key: "{{ aws_secret_key }}" - region: "{{ aws_region }}" - instance: "{{ instance_id }}" - id: "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" - modify_volume: false - register: volume_info - - - name: EC2 volume info - ansible.builtin.debug: - msg: Volume ID {{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}, Old size {{ volume_info.volume.size }}, New size {{ volume_info.volume.size|int + volume_size|int }} - - - name: Modify the volume - amazon.aws.ec2_vol: - aws_access_key_id: "{{ aws_access_key_id }}" - aws_secret_access_key: "{{ aws_secret_key }}" - region: "{{ aws_region }}" - instance: "{{ instance_id }}" - id: "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" - volume_size: "{{ volume_info.volume.size|int + volume_size|int }}" - volume_type: "{{ volume_type_default }}" - iops: "{{ iops | default(1300) if volume_type_default is regex('^io*') else omit }}" - modify_volume: true + - name: Get EC2 instance state + amazon.aws.ec2_instance: + aws_access_key_id: "{{ aws_access_key_id }}" + aws_secret_access_key: "{{ aws_secret_key }}" + region: "{{ aws_region }}" + instance_ids: [ "{{instance_id}}" ] + register: instances + + - name: EC2 instance info + ansible.builtin.debug: + msg: Instance ID {{ instances['instances'][0].instance_id }}, root volume {{ instances['instances'][0].block_device_mappings[0].ebs }} + + - name: Get current volume info + amazon.aws.ec2_vol: + aws_access_key_id: "{{ aws_access_key_id }}" + aws_secret_access_key: "{{ aws_secret_key }}" + region: "{{ aws_region }}" + instance: "{{ instance_id }}" + id: "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" + modify_volume: false + register: volume_info + + - name: EC2 volume info + ansible.builtin.debug: + msg: Volume ID {{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}, Old size {{ volume_info.volume.size }}, New size {{ volume_info.volume.size|int + volume_size|int }} + + - name: Modify the volume + amazon.aws.ec2_vol: + aws_access_key_id: "{{ aws_access_key_id }}" + aws_secret_access_key: "{{ aws_secret_key }}" + region: "{{ aws_region }}" + instance: "{{ instance_id }}" + id: "{{ instances['instances'][0].block_device_mappings[0].ebs.volume_id }}" + volume_size: "{{ volume_info.volume.size|int + volume_size|int }}" + volume_type: "{{ volume_type_default }}" + iops: "{{ iops | default(1300) if volume_type_default is regex('^io*') else omit }}" + modify_volume: true From bb7acae42026f593ef48a42ec05ac2c78b4f9cb9 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:41:56 +0200 Subject: [PATCH 17/31] Fix missing packaging python. --- scripts/ansible/aws/ec2-modify-volume-size.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index a740f199c..981467c4d 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -4,14 +4,17 @@ vars: instance_name: "{{ name }} (created by ansible)" volume_type_default: "{{ volume_type | default('io1') }}" - ansible_python_interpreter: /usr/bin/python3 pre_tasks: - - name: Install dependencies - pip: name={{ item }} - with_items: - - boto3 - - botocore + + - name: Ensure packaging is available + ansible.builtin.raw: '{{ ansible_python_interpreter }} -m pip install --quiet --upgrade packaging' + + - name: Install dependencies + pip: name={{ item }} + with_items: + - boto3 + - botocore tasks: - name: Get EC2 instance state From f16d59d857523924511b3e501a8358017ca040e9 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:44:17 +0200 Subject: [PATCH 18/31] Fix missing packaging python. --- scripts/ansible/aws/ec2-modify-volume-size.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 981467c4d..0f7b8b06d 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -6,6 +6,8 @@ volume_type_default: "{{ volume_type | default('io1') }}" pre_tasks: + - name: Bootstrap packaging so Ansible's pip module can run + ansible.builtin.raw: '{{ ansible_python_interpreter }} -m ensurepip --upgrade || true' - name: Ensure packaging is available ansible.builtin.raw: '{{ ansible_python_interpreter }} -m pip install --quiet --upgrade packaging' From da0f20013a9129764744b4030a5d34a7dc12a0e6 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:50:32 +0200 Subject: [PATCH 19/31] Fix missing packaging python. --- .../ansible/aws/ec2-modify-volume-size.yml | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 0f7b8b06d..4aef1c77f 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -6,17 +6,21 @@ volume_type_default: "{{ volume_type | default('io1') }}" pre_tasks: - - name: Bootstrap packaging so Ansible's pip module can run - ansible.builtin.raw: '{{ ansible_python_interpreter }} -m ensurepip --upgrade || true' + - name: Ensure pip and packaging are installed via OS packages + ansible.builtin.shell: | + set -e + if command -v apt-get >/dev/null 2>&1; then + apt-get update -y + apt-get install -y python3-pip python3-packaging + else + echo "No supported package manager found"; exit 1 + fi - - name: Ensure packaging is available - ansible.builtin.raw: '{{ ansible_python_interpreter }} -m pip install --quiet --upgrade packaging' - - - name: Install dependencies - pip: name={{ item }} - with_items: - - boto3 - - botocore + - name: Install dependencies + pip: name={{ item }} + with_items: + - boto3 + - botocore tasks: - name: Get EC2 instance state From c27a93d0e1c7115aa611f32788b6a733c9ca8721 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:58:31 +0200 Subject: [PATCH 20/31] Fix missing packaging python. --- scripts/ansible/aws/ec2-modify-volume-size.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 4aef1c77f..336128557 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -12,6 +12,12 @@ if command -v apt-get >/dev/null 2>&1; then apt-get update -y apt-get install -y python3-pip python3-packaging + elif command -v dnf >/dev/null 2>&1; then + dnf install -y python3-pip python3-packaging + elif command -v yum >/dev/null 2>&1; then + yum install -y python3-pip python3-packaging + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache py3-pip py3-packaging else echo "No supported package manager found"; exit 1 fi From 74e93db3ba978cc10a9a73b83968e83aa616500e Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:01:56 +0200 Subject: [PATCH 21/31] Fix missing packaging python. --- .github/workflows/node-increase-disk.yml | 38 +++++++++++++++---- .../ansible/aws/ec2-modify-volume-size.yml | 16 -------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 3ec570f68..8182ce8c8 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -42,15 +42,37 @@ jobs: aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} aws_region: ${{vars.S3_REGION}} - - name: Run playbook - uses: arillso/action.playbook@main + # - name: Run playbook + # uses: arillso/action.playbook@main + # with: + # # Required, playbook filepath + # playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml + # inventory: ./ansible-hosts + # galaxy_file: ./scripts/ansible/aws/requirements.yml + # verbose: 3 + # extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + + - uses: actions/setup-python@v5 with: - # Required, playbook filepath - playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml - inventory: ./ansible-hosts - galaxy_file: ./scripts/ansible/aws/requirements.yml - verbose: 3 - extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + python-version: '3.11' + + - name: Install Ansible + deps + run: | + python -m pip install --upgrade pip + pip install "ansible-core>=2.16" boto3 botocore packaging + + - name: Galaxy install + run: ansible-galaxy install -r ./scripts/ansible/aws/requirements.yml + + - name: Run playbook + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} + run: | + ansible-playbook \ + -i ./ansible-hosts \ + --extra-vars "aws_region=${{ github.event.inputs.aws_region }} instance_id=${{ inputs.instance_id }} volume_size=${{ github.event.inputs.disk_size }} ansible_python_interpreter=/usr/bin/python3" \ + ./scripts/ansible/aws/ec2-modify-volume-size.yml - name: Wait for AWS to finish provisioning the disk run: sleep 30m diff --git a/scripts/ansible/aws/ec2-modify-volume-size.yml b/scripts/ansible/aws/ec2-modify-volume-size.yml index 336128557..8c9db6471 100644 --- a/scripts/ansible/aws/ec2-modify-volume-size.yml +++ b/scripts/ansible/aws/ec2-modify-volume-size.yml @@ -6,22 +6,6 @@ volume_type_default: "{{ volume_type | default('io1') }}" pre_tasks: - - name: Ensure pip and packaging are installed via OS packages - ansible.builtin.shell: | - set -e - if command -v apt-get >/dev/null 2>&1; then - apt-get update -y - apt-get install -y python3-pip python3-packaging - elif command -v dnf >/dev/null 2>&1; then - dnf install -y python3-pip python3-packaging - elif command -v yum >/dev/null 2>&1; then - yum install -y python3-pip python3-packaging - elif command -v apk >/dev/null 2>&1; then - apk add --no-cache py3-pip py3-packaging - else - echo "No supported package manager found"; exit 1 - fi - - name: Install dependencies pip: name={{ item }} with_items: From 788bf44731073cd3aba6ef5c26d50943f5ce5e6a Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:06:28 +0200 Subject: [PATCH 22/31] Fix missing packaging python. --- .github/workflows/node-increase-disk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 8182ce8c8..1de199b23 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -71,7 +71,7 @@ jobs: run: | ansible-playbook \ -i ./ansible-hosts \ - --extra-vars "aws_region=${{ github.event.inputs.aws_region }} instance_id=${{ inputs.instance_id }} volume_size=${{ github.event.inputs.disk_size }} ansible_python_interpreter=/usr/bin/python3" \ + --extra-vars "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" \ ./scripts/ansible/aws/ec2-modify-volume-size.yml - name: Wait for AWS to finish provisioning the disk From 152f339c7e3c66640c6730804fed50e60fdc4545 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 13:12:36 +0200 Subject: [PATCH 23/31] Debug. --- .github/workflows/node-increase-disk.yml | 73 +++++++++++------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 1de199b23..4dd4527fd 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -31,52 +31,42 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Get Hosts Config - id: get-hosts - uses: keithweaver/aws-s3-github-action@v1.0.0 - with: - command: cp - source: ${{vars.S3_ANSIBLE_HOST_FILE}} - destination: ./ansible-hosts - aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} - aws_region: ${{vars.S3_REGION}} - - # - name: Run playbook - # uses: arillso/action.playbook@main + # - name: Get Hosts Config + # id: get-hosts + # uses: keithweaver/aws-s3-github-action@v1.0.0 # with: - # # Required, playbook filepath - # playbook: ./scripts/ansible/aws/ec2-modify-volume-size.yml - # inventory: ./ansible-hosts - # galaxy_file: ./scripts/ansible/aws/requirements.yml - # verbose: 3 - # extra_vars: "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" + # command: cp + # source: ${{vars.S3_ANSIBLE_HOST_FILE}} + # destination: ./ansible-hosts + # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} + # aws_region: ${{vars.S3_REGION}} - - uses: actions/setup-python@v5 - with: - python-version: '3.11' + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' - - name: Install Ansible + deps - run: | - python -m pip install --upgrade pip - pip install "ansible-core>=2.16" boto3 botocore packaging + # - name: Install Ansible + deps + # run: | + # python -m pip install --upgrade pip + # pip install "ansible-core>=2.16" boto3 botocore packaging - - name: Galaxy install - run: ansible-galaxy install -r ./scripts/ansible/aws/requirements.yml + # - name: Galaxy install + # run: ansible-galaxy install -r ./scripts/ansible/aws/requirements.yml - - name: Run playbook - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} - run: | - ansible-playbook \ - -i ./ansible-hosts \ - --extra-vars "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" \ - ./scripts/ansible/aws/ec2-modify-volume-size.yml + # - name: Run playbook + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} + # run: | + # ansible-playbook \ + # -i ./ansible-hosts \ + # --extra-vars "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" \ + # ./scripts/ansible/aws/ec2-modify-volume-size.yml - - name: Wait for AWS to finish provisioning the disk - run: sleep 30m - shell: bash + # - name: Wait for AWS to finish provisioning the disk + # run: sleep 30m + # shell: bash - name: Extend file system id: extend-file-system @@ -93,7 +83,7 @@ jobs: - name: Get SSM output id: get-ssm-output - if: steps.extend-file-system.outcome == 'success' + # if: steps.extend-file-system.outcome == 'success' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} @@ -101,6 +91,7 @@ jobs: run: | COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details | jq -c .) echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV + echo "Command Output: $COMMAND_OUTPUT" - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') From d594e41a527778b0f7223cf683972eadf3ab1cba Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:31:29 +0200 Subject: [PATCH 24/31] Debug. --- .github/workflows/node-increase-disk.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 4dd4527fd..f678b374a 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -83,7 +83,6 @@ jobs: - name: Get SSM output id: get-ssm-output - # if: steps.extend-file-system.outcome == 'success' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} From cf6bf049c38b7a1aa6e39bb89c73e76526ceaf7e Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:16:00 +0200 Subject: [PATCH 25/31] Debug. --- .github/workflows/node-increase-disk.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index f678b374a..49d0bf6b1 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -82,6 +82,7 @@ jobs: {"commands":["sudo growpart /dev/nvme0n1 1", "sudo resize2fs /dev/nvme0n1p1"]} - name: Get SSM output + if: always() id: get-ssm-output env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 7c774cb0bb5007fb5cb2f0aecf310947543c8a0c Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 28 Oct 2025 11:13:14 +0200 Subject: [PATCH 26/31] Debug. --- .github/workflows/node-increase-disk.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 49d0bf6b1..35abab4ea 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -68,8 +68,20 @@ jobs: # run: sleep 30m # shell: bash - - name: Extend file system - id: extend-file-system + # - name: Extend file system + # id: extend-file-system + # uses: nohmad/aws-ssm-send-command-action@master + # with: + # aws-region: ${{ inputs.aws_region }} + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + # targets: | + # [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] + # document-name: AWS-RunShellScript + # parameters: | + # {"commands":["sudo growpart /dev/nvme0n1 1", "sudo resize2fs /dev/nvme0n1p1"]} + - name: Log disk info + id: log-disk-info uses: nohmad/aws-ssm-send-command-action@master with: aws-region: ${{ inputs.aws_region }} @@ -79,7 +91,7 @@ jobs: [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] document-name: AWS-RunShellScript parameters: | - {"commands":["sudo growpart /dev/nvme0n1 1", "sudo resize2fs /dev/nvme0n1p1"]} + {"commands": ["echo '--- Disk layout ---'", "lsblk -f", "echo '--- Root mount ---'", "findmnt /"]} - name: Get SSM output if: always() @@ -89,11 +101,11 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} AWS_DEFAULT_REGION: ${{ inputs.aws_region }} run: | - COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details | jq -c .) + COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.log-disk-info.outputs.command-id }} --details | jq -c .) echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV echo "Command Output: $COMMAND_OUTPUT" - - name: Check SSM output + - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') run: | echo "Error detected trying to extend the partition." From 64065c0559efd41f4ab3afc40fbc0c6f88fdf614 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 28 Oct 2025 11:22:24 +0200 Subject: [PATCH 27/31] Debug. --- .github/workflows/node-increase-disk.yml | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 35abab4ea..d7cfb7aae 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -68,20 +68,8 @@ jobs: # run: sleep 30m # shell: bash - # - name: Extend file system - # id: extend-file-system - # uses: nohmad/aws-ssm-send-command-action@master - # with: - # aws-region: ${{ inputs.aws_region }} - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} - # targets: | - # [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] - # document-name: AWS-RunShellScript - # parameters: | - # {"commands":["sudo growpart /dev/nvme0n1 1", "sudo resize2fs /dev/nvme0n1p1"]} - - name: Log disk info - id: log-disk-info + - name: Extend file system + id: extend-file-system uses: nohmad/aws-ssm-send-command-action@master with: aws-region: ${{ inputs.aws_region }} @@ -91,7 +79,19 @@ jobs: [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] document-name: AWS-RunShellScript parameters: | - {"commands": ["echo '--- Disk layout ---'", "lsblk -f", "echo '--- Root mount ---'", "findmnt /"]} + {"commands":["sudo growpart /dev/xvda 1", "sudo resize2fs /dev/xvda1"]} + # - name: Log disk info + # id: log-disk-info + # uses: nohmad/aws-ssm-send-command-action@master + # with: + # aws-region: ${{ inputs.aws_region }} + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + # targets: | + # [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] + # document-name: AWS-RunShellScript + # parameters: | + # {"commands": ["echo '--- Disk layout ---'", "lsblk -f", "echo '--- Root mount ---'", "findmnt /"]} - name: Get SSM output if: always() @@ -101,7 +101,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} AWS_DEFAULT_REGION: ${{ inputs.aws_region }} run: | - COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.log-disk-info.outputs.command-id }} --details | jq -c .) + COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details | jq -c .) echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV echo "Command Output: $COMMAND_OUTPUT" From 57a92584fabaed1f7ce7cb23c532def6884f0cd3 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 28 Oct 2025 11:36:04 +0200 Subject: [PATCH 28/31] Debug. --- .github/workflows/node-increase-disk.yml | 36 +++++++++++++++--------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index d7cfb7aae..0b39976a8 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -79,19 +79,19 @@ jobs: [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] document-name: AWS-RunShellScript parameters: | - {"commands":["sudo growpart /dev/xvda 1", "sudo resize2fs /dev/xvda1"]} - # - name: Log disk info - # id: log-disk-info - # uses: nohmad/aws-ssm-send-command-action@master - # with: - # aws-region: ${{ inputs.aws_region }} - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} - # targets: | - # [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] - # document-name: AWS-RunShellScript - # parameters: | - # {"commands": ["echo '--- Disk layout ---'", "lsblk -f", "echo '--- Root mount ---'", "findmnt /"]} + {"commands":["sudo resize2fs /dev/xvda1"]} + - name: Log disk info + id: log-disk-info + uses: nohmad/aws-ssm-send-command-action@master + with: + aws-region: ${{ inputs.aws_region }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} + targets: | + [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] + document-name: AWS-RunShellScript + parameters: | + {"commands": ["file -s /dev/xvd*", "df -h"]} - name: Get SSM output if: always() @@ -105,6 +105,16 @@ jobs: echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV echo "Command Output: $COMMAND_OUTPUT" + - name: Get SSM log info output + if: always() + id: get-ssm-log-info-output + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} + AWS_DEFAULT_REGION: ${{ inputs.aws_region }} + run: | + COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.log-disk-info.outputs.command-id }} --details | jq -c .) + echo "Command Output: $COMMAND_OUTPUT" - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') run: | From f3c9defa542b8882d08cb3f1fd10c04e8af80227 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Tue, 28 Oct 2025 11:50:27 +0200 Subject: [PATCH 29/31] Remove debug. --- .github/workflows/node-increase-disk.yml | 87 +++++++++--------------- 1 file changed, 32 insertions(+), 55 deletions(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index 0b39976a8..fe681bf51 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -31,42 +31,42 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # - name: Get Hosts Config - # id: get-hosts - # uses: keithweaver/aws-s3-github-action@v1.0.0 - # with: - # command: cp - # source: ${{vars.S3_ANSIBLE_HOST_FILE}} - # destination: ./ansible-hosts - # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} - # aws_region: ${{vars.S3_REGION}} + - name: Get Hosts Config + id: get-hosts + uses: keithweaver/aws-s3-github-action@v1.0.0 + with: + command: cp + source: ${{vars.S3_ANSIBLE_HOST_FILE}} + destination: ./ansible-hosts + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_KEY }} + aws_region: ${{vars.S3_REGION}} - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' + - uses: actions/setup-python@v5 + with: + python-version: '3.11' - # - name: Install Ansible + deps - # run: | - # python -m pip install --upgrade pip - # pip install "ansible-core>=2.16" boto3 botocore packaging + - name: Install Ansible + deps + run: | + python -m pip install --upgrade pip + pip install "ansible-core>=2.16" boto3 botocore packaging - # - name: Galaxy install - # run: ansible-galaxy install -r ./scripts/ansible/aws/requirements.yml + - name: Galaxy install + run: ansible-galaxy install -r ./scripts/ansible/aws/requirements.yml - # - name: Run playbook - # env: - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} - # run: | - # ansible-playbook \ - # -i ./ansible-hosts \ - # --extra-vars "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" \ - # ./scripts/ansible/aws/ec2-modify-volume-size.yml + - name: Run playbook + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} + run: | + ansible-playbook \ + -i ./ansible-hosts \ + --extra-vars "aws_region=${{github.event.inputs.aws_region}} instance_id=${{inputs.instance_id}} aws_secret_key=${{secrets.AWS_SECRET_KEY}} aws_access_key_id=${{secrets.AWS_ACCESS_KEY_ID}} volume_size=${{github.event.inputs.disk_size}} ansible_python_interpreter='/usr/bin/python3'" \ + ./scripts/ansible/aws/ec2-modify-volume-size.yml - # - name: Wait for AWS to finish provisioning the disk - # run: sleep 30m - # shell: bash + - name: Wait for AWS to finish provisioning the disk + run: sleep 30m + shell: bash - name: Extend file system id: extend-file-system @@ -79,19 +79,7 @@ jobs: [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] document-name: AWS-RunShellScript parameters: | - {"commands":["sudo resize2fs /dev/xvda1"]} - - name: Log disk info - id: log-disk-info - uses: nohmad/aws-ssm-send-command-action@master - with: - aws-region: ${{ inputs.aws_region }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} - targets: | - [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] - document-name: AWS-RunShellScript - parameters: | - {"commands": ["file -s /dev/xvd*", "df -h"]} + {"commands":["sudo growpart /dev/xvda 1", "sudo resize2fs /dev/xvda1"]} - name: Get SSM output if: always() @@ -103,18 +91,7 @@ jobs: run: | COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.extend-file-system.outputs.command-id }} --details | jq -c .) echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV - echo "Command Output: $COMMAND_OUTPUT" - - name: Get SSM log info output - if: always() - id: get-ssm-log-info-output - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} - AWS_DEFAULT_REGION: ${{ inputs.aws_region }} - run: | - COMMAND_OUTPUT=$(aws ssm list-command-invocations --command-id ${{ steps.log-disk-info.outputs.command-id }} --details | jq -c .) - echo "Command Output: $COMMAND_OUTPUT" - name: Check SSM output if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') run: | From d090774ab1e03b084d9b3e86f7d571e087346c9a Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:15:22 +0200 Subject: [PATCH 30/31] Fix error check. --- .github/workflows/node-increase-disk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index fe681bf51..d56b1f23f 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -93,7 +93,7 @@ jobs: echo "COMMAND_OUTPUT=$COMMAND_OUTPUT" >> $GITHUB_ENV - name: Check SSM output - if: steps.get-ssm-output.outcome == 'success' && contains(env.COMMAND_OUTPUT, 'error') + if: steps.get-ssm-output.outcome == 'success' && !contains(env.COMMAND_OUTPUT, 'Status:Success') run: | echo "Error detected trying to extend the partition." echo ${{env.COMMAND_OUTPUT}} From 22c002d8e8f4c27cba406818c132eb382178fab3 Mon Sep 17 00:00:00 2001 From: Robert Vintila <33718597+gasher@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:28:20 +0200 Subject: [PATCH 31/31] Parametrize node-increase-disk. --- .github/workflows/node-increase-disk.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node-increase-disk.yml b/.github/workflows/node-increase-disk.yml index d56b1f23f..3a70a96c5 100644 --- a/.github/workflows/node-increase-disk.yml +++ b/.github/workflows/node-increase-disk.yml @@ -18,6 +18,18 @@ on: description: "The amount of diskspace to add (GB)" default: "50" required: true + disk: + description: "The disk to increase using growpart (e.g., /dev/xvda)" + default: "/dev/xvda" + required: true + partition_number: + description: "The partition number to extend using growpart (e.g., 1)" + default: "1" + required: true + partition_device: + description: "The partition device to extend using resize2fs (e.g., /dev/xvda1)" + default: "/dev/xvda1" + required: true jobs: @@ -79,7 +91,12 @@ jobs: [{"Key":"InstanceIds","Values":["${{ inputs.instance_id }}"]}] document-name: AWS-RunShellScript parameters: | - {"commands":["sudo growpart /dev/xvda 1", "sudo resize2fs /dev/xvda1"]} + { + "commands":[ + "sudo growpart ${{ inputs.disk }} ${{ inputs.partition_number }}", + "sudo resize2fs ${{ inputs.partition_device }}" + ] + } - name: Get SSM output if: always()