{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/49226","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/49226/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/49226/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/49226/events","html_url":"https://github.com/saltstack/salt/issues/49226","id":352535248,"node_id":"MDU6SXNzdWUzNTI1MzUyNDg=","number":49226,"title":"salt-cloud grains inheritance from provider to profile (2018 vs 2016)","user":{"login":"defanator","id":1309027,"node_id":"MDQ6VXNlcjEzMDkwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1309027?v=4","gravatar_id":"","url":"https://api.github.com/users/defanator","html_url":"https://github.com/defanator","followers_url":"https://api.github.com/users/defanator/followers","following_url":"https://api.github.com/users/defanator/following{/other_user}","gists_url":"https://api.github.com/users/defanator/gists{/gist_id}","starred_url":"https://api.github.com/users/defanator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defanator/subscriptions","organizations_url":"https://api.github.com/users/defanator/orgs","repos_url":"https://api.github.com/users/defanator/repos","events_url":"https://api.github.com/users/defanator/events{/privacy}","received_events_url":"https://api.github.com/users/defanator/received_events","type":"User","site_admin":false},"labels":[{"id":41662302,"node_id":"MDU6TGFiZWw0MTY2MjMwMg==","url":"https://api.github.com/repos/saltstack/salt/labels/Duplicate","name":"Duplicate","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestone/37","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"node_id":"MDk6TWlsZXN0b25lMzQzNzQx","number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"node_id":"MDQ6VXNlcjcwMjMxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/702318?v=4","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":917,"closed_issues":2623,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2018-08-21T14:18:19Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-08-21T13:20:58Z","updated_at":"2018-08-21T14:40:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description of Issue/Question\r\n\r\nAfter upgrading salt-cloud from 2016.11.6 to 2018.3.2 we've been observing a situation when provider-specific grains have not been applied to the target instance.\r\n\r\n### Setup\r\n\r\nExcerpt from our initial configuration that was working fine with 2016.11.6:\r\n\r\n```\r\nprov1:\r\n  driver: ec2\r\n  minion:\r\n    master: x.x.x.x\r\n  grains:\r\n    prov1_grain1: foo\r\n    prov2_grain2: bar\r\n\r\nprofile1:\r\n  provider: prov1\r\n  grains:\r\n    env: nonprod\r\n    roles:\r\n      - role1\r\n      - role2\r\n      - role2\r\n```\r\n\r\nTarget instance launched with 2016.11.6 contained all the grains merged in a proper way, i.e.:\r\n\r\n```\r\nprov1_grain1: foo\r\nprov1_grain2: bar\r\nenv: nonprod\r\nroles:\r\n- role1\r\n- role2\r\n- role3\r\n```\r\n\r\nTarget instance launched with 2018.3.2 contained just the grains from profile:\r\n\r\n```\r\nenv: nonprod\r\nroles:\r\n- role1\r\n- role2\r\n- role3\r\n```\r\n\r\nWe finally managed to get it working by changing provider configuration to the following:\r\n\r\n```\r\nprov1:\r\n  driver: ec2\r\n  minion:\r\n    master: x.x.x.x\r\n    grains:\r\n      prov1_grain1: foo\r\n      prov2_grain2: bar\r\n```\r\n\r\nI.e., `grains` tree should be under `minion` now.\r\n\r\nHowever, documentation examples still contain older (legacy?) syntax:\r\n\r\n```\r\n# Note: This example is for /etc/salt/cloud.providers or any file in the\r\n# /etc/salt/cloud.providers.d/ directory.\r\n\r\nmy-ec2-southeast-public-ips:\r\n  # Set up the location of the salt master\r\n  #\r\n  minion:\r\n    master: saltmaster.example.com\r\n\r\n  # Set up grains information, which will be common for all nodes\r\n  # using this provider\r\n  grains:\r\n    node_type: broker\r\n    release: 1.0.1\r\n```\r\n\r\n(from https://docs.saltstack.com/en/latest/topics/cloud/aws.html)\r\n\r\nMy questions so far:\r\n - is current behavior correct? (grains should be nested from minion in provider config, but not in profile config),\r\n - should a documentation be changed accordingly?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/414698369","html_url":"https://github.com/saltstack/salt/issues/49226#issuecomment-414698369","issue_url":"https://api.github.com/repos/saltstack/salt/issues/49226","id":414698369,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDY5ODM2OQ==","user":{"login":"defanator","id":1309027,"node_id":"MDQ6VXNlcjEzMDkwMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1309027?v=4","gravatar_id":"","url":"https://api.github.com/users/defanator","html_url":"https://github.com/defanator","followers_url":"https://api.github.com/users/defanator/followers","following_url":"https://api.github.com/users/defanator/following{/other_user}","gists_url":"https://api.github.com/users/defanator/gists{/gist_id}","starred_url":"https://api.github.com/users/defanator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defanator/subscriptions","organizations_url":"https://api.github.com/users/defanator/orgs","repos_url":"https://api.github.com/users/defanator/repos","events_url":"https://api.github.com/users/defanator/events{/privacy}","received_events_url":"https://api.github.com/users/defanator/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T14:40:32Z","updated_at":"2018-08-21T14:40:32Z","author_association":"CONTRIBUTOR","body":"@gtmanfred I've just removed all .pyc files within salt directory, returned provider configuration to the initial format:\r\n\r\n```\r\nprov1:\r\n  driver: ec2\r\n  minion:\r\n    master: x.x.x.x\r\n  grains:\r\n    prov1_grain1: foo\r\n    prov2_grain2: bar\r\n```\r\n\r\nand checked with launching new instance from that profile - provider's grains are missing.\r\n\r\nLet me know if I can provide anything else to help with investigating this one."}}
{"actor":{"display_login":"defanator"}}