From 6ff1092e6993e9fadb7b6344eac4aef75b2ea97b Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 27 Sep 2024 12:30:13 +0200 Subject: [PATCH] ci: how to setup custom testing machine --- .../setup-playbook/README.md | 54 +++++++++++++++++++ .../setup-playbook/roles/fix-root-ssh | 2 +- .../spawn-test-machine-ec2.yaml | 4 +- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 mock/integration-tests/setup-playbook/README.md diff --git a/mock/integration-tests/setup-playbook/README.md b/mock/integration-tests/setup-playbook/README.md new file mode 100644 index 000000000..554123a8c --- /dev/null +++ b/mock/integration-tests/setup-playbook/README.md @@ -0,0 +1,54 @@ +Starting EC2 machine +-------------------- + +1. init git submodules + + git submodule update --init --recursive + +2. setup AWS vars like this (change fields appropriately): + + cat > group_vars/all.yaml < + aws_secret_access_key= + +4. start the machine + + ansible-playbook spawn-test-machine-ec2.yaml + + PLAY [Start new machine] ******************* + + TASK [create the testing mock vm in ec2] *** + changed: [localhost] + + TASK [print ipv4] ************************** + ok: [localhost] => { + "msg": [ + "Instance ID: i-02f769285490cbb64", + "Network ID: eni-0298fa7a391ecc42e", + "Unusable Public IP: 107.20.103.13" + ] + } + + PLAY RECAP ******************************** + localhost : ok=2 changed=1 unreachable=0 ... diff --git a/mock/integration-tests/setup-playbook/roles/fix-root-ssh b/mock/integration-tests/setup-playbook/roles/fix-root-ssh index bcb48407e..a88a81be0 160000 --- a/mock/integration-tests/setup-playbook/roles/fix-root-ssh +++ b/mock/integration-tests/setup-playbook/roles/fix-root-ssh @@ -1 +1 @@ -Subproject commit bcb48407efc3e2431ea7ab3da5cce9abc8bb2aba +Subproject commit a88a81be0fdff38957b20308849f0a511052e46a diff --git a/mock/integration-tests/setup-playbook/spawn-test-machine-ec2.yaml b/mock/integration-tests/setup-playbook/spawn-test-machine-ec2.yaml index 3352eeb56..81e5cf6a9 100644 --- a/mock/integration-tests/setup-playbook/spawn-test-machine-ec2.yaml +++ b/mock/integration-tests/setup-playbook/spawn-test-machine-ec2.yaml @@ -8,7 +8,7 @@ amazon.aws.ec2_instance: name: "testing-mock" state: running - profile: fedora-copr + profile: "{{ aws.profile }}" region: us-east-1 key_name: "{{ aws.ssh_key }}" count: 1 @@ -17,7 +17,7 @@ detailed_monitoring: true network: assign_public_ip: true - vpc_subnet_id: "{{ infra_subnet }}" + vpc_subnet_id: "{{ aws.infra_subnet }}" security_group: "{{ aws.security_group }}" termination_protection: false wait: true