diff --git a/.github/workflows/component_canaries.yml b/.github/workflows/component_canaries.yml index 61675e6d9..e2ddeb633 100644 --- a/.github/workflows/component_canaries.yml +++ b/.github/workflows/component_canaries.yml @@ -52,7 +52,7 @@ jobs: uses: newrelic/fargate-runner-action@main with: aws_region: us-east-2 - container_make_target: "canaries PLATFORM=${{ inputs.PLATFORM }} ANSIBLE_FORKS=${{ env.ANSIBLE_FORKS }} VERSION=${{ inputs.TAG }} CROWDSTRIKE_CLIENT_ID=${{ secrets.CROWDSTRIKE_CLIENT_ID }} CROWDSTRIKE_CLIENT_SECRET=${{ secrets.CROWDSTRIKE_CLIENT_SECRET }} CROWDSTRIKE_CUSTOMER_ID=${{ secrets.CROWDSTRIKE_CUSTOMER_ID }}" + container_make_target: "macos-canaries PLATFORM=${{ inputs.PLATFORM }} ANSIBLE_FORKS=${{ env.ANSIBLE_FORKS }} VERSION=${{ inputs.TAG }} CROWDSTRIKE_CLIENT_ID=${{ secrets.CROWDSTRIKE_CLIENT_ID }} CROWDSTRIKE_CLIENT_SECRET=${{ secrets.CROWDSTRIKE_CLIENT_SECRET }} CROWDSTRIKE_CUSTOMER_ID=${{ secrets.CROWDSTRIKE_CUSTOMER_ID }}" ecs_cluster_name: caos_infra_agent task_definition_name: infra-agent cloud_watch_logs_group_name: /ecs/test-prerelease-infra-agent @@ -152,7 +152,7 @@ jobs: echo "TERRAFORM_STATE_CURRENT=canaries-${{ inputs.PLATFORM }}-${{ inputs.TAG }}-current" >> $GITHUB_ENV echo "INVENTORY_PREVIOUS=/srv/runner/inventory/canary-${{ inputs.TAG }}-${{ inputs.PLATFORM }}-previous-inventory.ec2" >> $GITHUB_ENV echo "INVENTORY_CURRENT=/srv/runner/inventory/canary-${{ inputs.TAG }}-${{ inputs.PLATFORM }}-current-inventory.ec2" >> $GITHUB_ENV - + - name: Provision instances ${{ inputs.PLATFORM }} previous uses: newrelic/fargate-runner-action@main with: diff --git a/test/automated/ansible/roles/create-macos-inventory/templates/inventory.macos.ec2.j2 b/test/automated/ansible/roles/create-macos-inventory/templates/inventory.macos.ec2.j2 index 1c46047b5..33339788c 100644 --- a/test/automated/ansible/roles/create-macos-inventory/templates/inventory.macos.ec2.j2 +++ b/test/automated/ansible/roles/create-macos-inventory/templates/inventory.macos.ec2.j2 @@ -27,4 +27,4 @@ ansible_sudo_pass='{{ macstadium_sudo_pass }}' [macos_previous:vars] ansible_ssh_private_key_file={{ ec2_private_key_file }} ansible_ssh_common_args='-o StrictHostKeyChecking=no' -ansible_sudo_pass='{{ macstadium_sudo_pass }}' \ No newline at end of file +ansible_sudo_pass='{{ macstadium_sudo_pass }}' diff --git a/test/canaries/Makefile b/test/canaries/Makefile index c0b637464..ed6d8c0a6 100644 --- a/test/canaries/Makefile +++ b/test/canaries/Makefile @@ -25,6 +25,24 @@ ifndef NR_LICENSE_KEY_CANARIES endif ansible-playbook -f $(ANSIBLE_FORKS) -i $(ANSIBLE_INVENTORY) "$(ANSIBLE_FOLDER)/deploy_canaries.yml" -e "current_version=$(VERSION) previous_version=$(PREVIOUS_VERSION) nr_license_key=$(NR_LICENSE_KEY_CANARIES) docker_username=$(DOCKER_USERNAME) docker_password=$(DOCKER_PASSWORD)" +.PHONY: macos-canaries +macos-canaries: +ifndef ANSIBLE_INVENTORY + $(error ANSIBLE_INVENTORY is not set) +endif +ifndef MACSTADIUM_USER + $(error MACSTADIUM_USER \(MacStadium account username for API\) variable must be provided) +endif +ifndef MACSTADIUM_PASS + $(error MACSTADIUM_PASS \(MacStadium password for API\) variable must be provided) +endif +ifndef MACSTADIUM_SUDO_PASS + $(error MACSTADIUM_SUDO_PASS \(MacStadium sudo password\) variable must be provided) +endif + ansible-playbook -f $(ANSIBLE_FORKS) -i $(ANSIBLE_INVENTORY) "$(ANSIBLE_FOLDER)/deploy_macos_canaries.yml" -e "macstadium_user=$(MACSTADIUM_USER) macstadium_pass=$(MACSTADIUM_PASS) macstadium_sudo_pass=$(MACSTADIUM_SUDO_PASS) output_inventory_macos=$(CURDIR)/inventory.macos.ec2 platform=macos" + sed -i.bak "s/canary:current/canary-macos:v$(VERSION)/g" $(CURDIR)/inventory.macos.ec2 + sed -i.bak "s/canary:previous/canary-macos:v$(PREVIOUS_VERSION)/g" $(CURDIR)/inventory.macos.ec2 + cat $(CURDIR)/inventory.macos.ec2 .PHONY: clean clean: ansible/clean diff --git a/test/canaries/deploy_macos_canaries.yml b/test/canaries/deploy_macos_canaries.yml new file mode 100644 index 000000000..1ef411ba7 --- /dev/null +++ b/test/canaries/deploy_macos_canaries.yml @@ -0,0 +1,13 @@ +--- + +- hosts: localhost + become: false + gather_facts: no + + tasks: + - name: Featch, prepare and create macos canaries inventory + vars: + username: administrator + output_inventory: "{{ output_inventory_macos | default('inventory.macos.ec2') }}" + include_role: + name: caos.ansible_roles.prepare_macos_inventory diff --git a/test/canaries/requirements.yml b/test/canaries/requirements.yml index db3e14dfa..efee8294f 100644 --- a/test/canaries/requirements.yml +++ b/test/canaries/requirements.yml @@ -1,6 +1,7 @@ collections: - name: git+https://github.com/newrelic-experimental/caos-ansible-roles.git#/caos.ansible_roles/ type: git + version: NR-164384_add_macos_roles roles: - name: geerlingguy.pip