From 65f0b263a1af170802215823d6e354f8bdfa5f39 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Mon, 4 Dec 2017 16:49:15 -0700 Subject: salt: configure grains in grains file rather than in minion config. While salt grains can be configured in the minion config file, it is usually better to configure it in the /etc/salt/grains file. This allows that to be done. --- tests/cloud_tests/testcases/modules/salt_minion.py | 5 +++++ tests/cloud_tests/testcases/modules/salt_minion.yaml | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'tests/cloud_tests/testcases') diff --git a/tests/cloud_tests/testcases/modules/salt_minion.py b/tests/cloud_tests/testcases/modules/salt_minion.py index c697db2d..f13b48a0 100644 --- a/tests/cloud_tests/testcases/modules/salt_minion.py +++ b/tests/cloud_tests/testcases/modules/salt_minion.py @@ -26,4 +26,9 @@ class Test(base.CloudTestCase): self.assertIn('', out) self.assertIn('------END PUBLIC KEY-------', out) + def test_grains(self): + """Test master value in config.""" + out = self.get_data_file('grains') + self.assertIn('role: web', out) + # vi: ts=4 expandtab diff --git a/tests/cloud_tests/testcases/modules/salt_minion.yaml b/tests/cloud_tests/testcases/modules/salt_minion.yaml index f20d24f0..ab0e05bb 100644 --- a/tests/cloud_tests/testcases/modules/salt_minion.yaml +++ b/tests/cloud_tests/testcases/modules/salt_minion.yaml @@ -17,6 +17,8 @@ cloud_config: | ------BEGIN PRIVATE KEY------ ------END PRIVATE KEY------- + grains: + role: web collect_scripts: minion: | #!/bin/bash @@ -30,5 +32,8 @@ collect_scripts: minion.pub: | #!/bin/bash cat /etc/salt/pki/minion/minion.pub + grains: | + #!/bin/bash + cat /etc/salt/grains # vi: ts=4 expandtab -- cgit v1.2.3