ansible-collections / community.sops

Simple and flexible tool for managing secrets
https://galaxy.ansible.com/ui/repo/published/community/sops/
GNU General Public License v3.0
76 stars 22 forks source link

MacOS Install not working #128

Open simbleau opened 1 year ago

simbleau commented 1 year ago

To cut to the chase:

PLAY [Provision System] *********************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************************
[WARNING]: Platform darwin on host 127.0.0.1 is using the discovered Python interpreter at /usr/bin/python3, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible-
core/2.14/reference_appendices/interpreter_discovery.html for more information.
ok: [127.0.0.1]

TASK [Install SOPS] *************************************************************************************************************************************************************************************************************************************

TASK [community.sops.install : Validating arguments against arg spec 'main' - Install Mozilla sops] *****************************************************************************************************************************************************
ok: [127.0.0.1]

TASK [community.sops.install : Gather required information on localhost] ********************************************************************************************************************************************************************************
ok: [127.0.0.1 -> localhost]

TASK [community.sops.install : Show system information] *************************************************************************************************************************************************************************************************
ok: [127.0.0.1] => {
    "msg": "Architecture: arm64\nDistribution: MacOSX 13\nDistribution version: 13.0.1\nOS family: Darwin"
}

TASK [community.sops.install : Include distribution specific variables] *********************************************************************************************************************************************************************************
ok: [127.0.0.1]

TASK [community.sops.install : Start determining source] ************************************************************************************************************************************************************************************************
ok: [127.0.0.1]

TASK [community.sops.install : Auto-detect source to install sops from] *********************************************************************************************************************************************************************************
included: /Users/simbleau/.ansible/collections/ansible_collections/community/sops/roles/install/tasks/detect_source.yml for 127.0.0.1

TASK [community.sops.install : Check whether system packages are a valid source of sops latest] *********************************************************************************************************************************************************
skipping: [127.0.0.1]

TASK [community.sops.install : Check whether GitHub is a valid source of sops] **************************************************************************************************************************************************************************
skipping: [127.0.0.1]

TASK [community.sops.install : Ensure that something was detected] **************************************************************************************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Was not able to determine installation source for sops latest for MacOSX 13.0.1. Please open an issue in https://github.com/ansible-collections/community.sops/issues if you think this should work."}

NO MORE HOSTS LEFT **************************************************************************************************************************************************************************************************************************************

PLAY RECAP **********************************************************************************************************************************************************************************************************************************************
127.0.0.1                  : ok=7    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0
felixfontein commented 1 year ago

That's no surprise, since macOS is not supported by the role. Please see the role's documentation at https://ansible-collections.github.io/community.sops/branch/main/install_role.html#synopsis:

This role supports the following operating systems: Alpine (new enough), Arch Linux, CentOS 7, Stream 8, or newer, Debian 10 (Buster) or newer, Fedora (new enough), RHEL 7 or newer, Ubuntu 16.04 or newer LTS versions

simbleau commented 1 year ago

Could this get support?

felixfontein commented 1 year ago

If someone wants to implement this, sure.

simbleau commented 1 year ago

Still hoping someone picks this up 🙏

brandonkal commented 2 months ago

Why is this required if sops is already installed via homebrew?

felixfontein commented 2 months ago

@brandonkal you don't need to install SOPS if it is already installed. Or what exactly do you mean?

brandonkal commented 2 months ago

I was not able to get community.sops working on macOS. So ended up having to use this workaround:

run//default (playbook=playbooks/setup.yaml)

Run playbook with sops

Note that the community.sops plugin is broken and doesn't work well on macOS, so we use command substitution instead

ANSIBLE_CONFIG=./ansible.cfg ansible-playbook "$playbook" -e "$(sops -d --output-type=json secrets.sops.yaml)"
felixfontein commented 2 months ago

@brandonkal your problem seems to be unrelated to this issue, since it's not about using the community.sops.install role.

Could you please create a new issue and include some more details, for example which plugin this is about? It is very unclear to me from your description what is actually not working.

brandonkal commented 2 months ago

I am sorry I cannot provide more detail as I have mentioned above I have already found a workaround that always works.

Using community.sops plugins broke in weird ways. Maybe it is because of python environment issues on Mac. The ansible documentation seems to suggest that sops.install is required when it was not.