|
18 | 18 | register: probe_aws |
19 | 19 | when: cloud_platform_name is undefined or cloud_platform_name | length == 0 |
20 | 20 |
|
21 | | - - name: "Probe for AWS 1" |
22 | | - become: true |
23 | | - become_user: root |
24 | | - ansible.builtin.command: dmidecode -s bios-version # | grep -iq "Amazon" |
25 | | - changed_when: false |
26 | | - failed_when: false |
27 | | - register: probe_aws_1 |
28 | | - when: cloud_platform_name is undefined or cloud_platform_name | length == 0 or cloud_platform_name == "aws" |
29 | | - |
30 | | - - name: Set AWS machine type fact |
31 | | - ansible.builtin.set_fact: |
32 | | - aws_machine_type_is_r4: true |
33 | | - when: |
34 | | - - cloud_platform_name is undefined or cloud_platform_name | length == 0 or cloud_platform_name == "aws" |
35 | | - - probe_aws_1.stdout is match(".*amazon") |
36 | | - |
37 | 21 | - name: Set AWS discovery fact |
38 | 22 | ansible.builtin.set_fact: |
39 | 23 | cloud_platform_is_aws: true |
40 | 24 | when: |
41 | 25 | - cloud_platform_name is undefined or cloud_platform_name | length == 0 |
42 | 26 | - probe_aws.rc == 0 |
43 | | - - probe_aws.stdout | lower == 'amazon ec2' or probe_aws_1.stdout is match(".*amazon") |
| 27 | + - probe_aws.stdout | lower == 'amazon ec2' |
44 | 28 |
|
45 | | - - name: Set AWS from var |
| 29 | + - name: Set AWS from var |
46 | 30 | ansible.builtin.set_fact: |
47 | 31 | cloud_platform_is_aws: true |
48 | 32 | when: cloud_platform_name is defined and cloud_platform_name == "aws" |
49 | 33 |
|
| 34 | + - name: Set AWS machine type fact for R4 instances |
| 35 | + ansible.builtin.set_fact: |
| 36 | + aws_machine_type_is_r4: true |
| 37 | + when: |
| 38 | + - cloud_platform_name is undefined or cloud_platform_name | length == 0 or cloud_platform_name == "aws" |
| 39 | + - hana_machinetype is match("r4.*") |
| 40 | + |
50 | 41 | # SEE: https://stackoverflow.com/questions/30911775/how-to-know-if-a-machine-is-an-google-compute-engine-instance |
51 | 42 | - name: "Detect GCP" |
52 | 43 | block: |
|
0 commit comments