Open tyhunt99 opened 3 years ago
I was wondering if there were any updates on this. It is making the management of instances in AWS rather tedious. Thanks
I have also found this issue when using a mapfile. It does not check the correct AWS account for the presence of the servers defined inside the mapfile specified.
I suspect this to be the case with other providers in general, as I seem to have the same problem with different providers/credentials for Hetzner Cloud
Description I created an instance in a different AWS account than my salt master using
salt-cloud -p aws-vp-docker-host dockertest
. When I try to delete that minion viasalt-cloud -d dockertest
it fails to find the minion with following output:No machines were found to be destroyed
Setup
log output
``` $ salt-cloud --log-level debug -d dockertest [DEBUG ] Reading configuration from /etc/salt/cloud [DEBUG ] Reading configuration from /etc/salt/master [DEBUG ] Including configuration from '/etc/salt/master.d/gitfs.conf' [DEBUG ] Reading configuration from /etc/salt/master.d/gitfs.conf [DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf' [DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf [DEBUG ] Changed git to gitfs in master opts' fileserver_backend list [DEBUG ] Using cached minion ID from /etc/salt/minion_id: use1-salt01.ipa.prd.localnet.io [DEBUG ] Missing configuration file: /etc/salt/cloud.providers [DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws_bv.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws_bv.conf [DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws_vp.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws_vp.conf [DEBUG ] Missing configuration file: /etc/salt/cloud.profiles [DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/bv.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/bv.conf [DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/datadog.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/datadog.conf [DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/docker.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/docker.conf [DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/mmmsg.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/mmmsg.conf [DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/vos_application.conf' [DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/vos_application.conf [DEBUG ] Using pkg_resources to load entry points [DEBUG ] Override __grains__:aws-vp-ec2 provider (the salt master instance is in a different aws account than the role_arn)
profile being used:
Steps to Reproduce the behavior
salt-cloud -d
Expected behavior The minion is found and deleted properly.
Screenshots N/A
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) ``` Salt Version: Salt: 3003.2 Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.6.1 docker-py: Not Installed gitdb: 2.0.3 gitpython: 2.1.8 Jinja2: 2.10 libgit2: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack: 0.5.6 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: 3.4.7 pygit2: Not Installed Python: 3.6.9 (default, Jan 26 2021, 15:33:00) python-gnupg: 0.4.1 PyYAML: 3.12 PyZMQ: 17.1.2 smmap: 2.0.3 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.2.5 System Versions: dist: ubuntu 18.04 Bionic Beaver locale: UTF-8 machine: x86_64 release: 5.4.0-1054-aws system: Linux version: Ubuntu 18.04 Bionic Beaver ```Additional context xxxxxxxxxx - refers to the other AWS account nnnnnnnnnn - refers to the main AWS where salt master lives
I also tried to specify the profile of the original salt-cloud call with
salt-cloud -p aws-vp-docker-host -d dockertest
and that did not work because I believe most other flags are ignored when-d
is specified.I also have the salt-cloud grains enabled and it has this in the minion: