Skip to content

Commit

Permalink
Merge pull request #38 from darkwizard242/feature/multi-arch-support
Browse files Browse the repository at this point in the history
Support multiple Architectures
  • Loading branch information
darkwizard242 authored Jun 24, 2024
2 parents d9a9a14 + c901632 commit f4e9f0a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ Available variables are listed below (located in `defaults/main.yml`):
```yaml
infracost_app: infracost
infracost_version: 0.10.37
infracost_os: linux
infracost_arch: amd64
infracost_dl_url: https://github.com/{{ infracost_app }}/{{ infracost_app }}/releases/download/v{{ infracost_version }}/{{ infracost_app }}-{{ infracost_os }}-{{ infracost_arch }}.tar.gz
infracost_os: "{{ ansible_system | lower }}"
infracost_architecture_map:
amd64: amd64
arm: arm64
x86_64: amd64
armv6l: armv6
armv7l: armv7
aarch64: arm64
32-bit: "386"
64-bit: amd64
infracost_dl_url: https://github.com/{{ infracost_app }}/{{ infracost_app }}/releases/download/v{{ infracost_version }}/{{ infracost_app }}-{{ infracost_os }}-{{ infracost_architecture_map[ansible_architecture] }}.tar.gz
infracost_bin_path: /usr/local/bin
infracost_file_owner: root
infracost_file_group: root
Expand All @@ -32,8 +40,8 @@ Variable | Description
------------------------------ | -----------------------------------------------------------------------------------------------------------------------------------------------------------
infracost_app | Defines the app to install i.e. **infracost**
infracost_version | Defined to dynamically fetch the desired version to install. Defaults to: **0.10.37**
infracost_os | Defines os type. Defaults to: **linux**
infracost_arch | Defines os architecture. Defaults to: **amd64**
infracost_os | Defines os type.
infracost_architecture_map | Defines os architecture.
infracost_dl_url | Defines URL to download the infracost binary from.
infracost_bin_path | Defined to dynamically set the appropriate path to store infracost binary into. Defaults to (as generally available on any user's PATH): **/usr/local/bin**
infracost_file_owner | Owner for the binary file of infracost.
Expand Down
14 changes: 11 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@

infracost_app: infracost
infracost_version: 0.10.37
infracost_os: linux
infracost_arch: amd64
infracost_dl_url: https://github.com/{{ infracost_app }}/{{ infracost_app }}/releases/download/v{{ infracost_version }}/{{ infracost_app }}-{{ infracost_os }}-{{ infracost_arch }}.tar.gz
infracost_os: "{{ ansible_system | lower }}"
infracost_architecture_map:
amd64: amd64
arm: arm64
x86_64: amd64
armv6l: armv6
armv7l: armv7
aarch64: arm64
32-bit: "386"
64-bit: amd64
infracost_dl_url: https://github.com/{{ infracost_app }}/{{ infracost_app }}/releases/download/v{{ infracost_version }}/{{ infracost_app }}-{{ infracost_os }}-{{ infracost_architecture_map[ansible_architecture] }}.tar.gz
infracost_bin_path: /usr/local/bin
infracost_file_owner: root
infracost_file_group: root
Expand Down
2 changes: 1 addition & 1 deletion tasks/install_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
dest: "{{ infracost_bin_path }}"
extra_opts:
- --transform
- s/{{ infracost_app }}\-{{ infracost_os }}\-{{ infracost_arch }}/{{ infracost_app }}/
- s/{{ infracost_app }}\-{{ infracost_os }}\-{{ infracost_architecture_map[ansible_architecture] }}/{{ infracost_app }}/
remote_src: yes
owner: "{{ infracost_file_owner }}"
group: "{{ infracost_file_group }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/install_el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
dest: "{{ infracost_bin_path }}"
extra_opts:
- --transform
- s/{{ infracost_app }}\-{{ infracost_os }}\-{{ infracost_arch }}/{{ infracost_app }}/
- s/{{ infracost_app }}\-{{ infracost_os }}\-{{ infracost_architecture_map[ansible_architecture] }}/{{ infracost_app }}/
remote_src: yes
owner: "{{ infracost_file_owner }}"
group: "{{ infracost_file_group }}"
Expand Down

0 comments on commit f4e9f0a

Please sign in to comment.