mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-15 22:34:21 +03:00
Update to ansible 2.15 (#10481)
* ansible: upgrade to version >= 2.15.5 Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr> * tests: update requirements Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr> * contrib/openstack: fix wrong gitignore pattern Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr> * tests: add missing tzdata requirement Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr> * tests: remove some molecules tests Those doesn't work in Ansible 2.15. Ansible can't load builtin now apparently and these tests are not worth it. Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
This commit is contained in:
committed by
GitHub
parent
cbd3a83a06
commit
7ba85710ad
@@ -1,40 +0,0 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
import yaml
|
||||
from ansible.cli.playbook import PlaybookCLI
|
||||
from ansible.playbook import Playbook
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ["MOLECULE_INVENTORY_FILE"]
|
||||
).get_hosts("all")
|
||||
|
||||
|
||||
def read_playbook(playbook):
|
||||
cli_args = [os.path.realpath(playbook), testinfra_hosts]
|
||||
cli = PlaybookCLI(cli_args)
|
||||
cli.parse()
|
||||
loader, inventory, variable_manager = cli._play_prereqs()
|
||||
|
||||
pb = Playbook.load(cli.args[0], variable_manager, loader)
|
||||
|
||||
for play in pb.get_plays():
|
||||
yield variable_manager.get_vars(play)
|
||||
|
||||
|
||||
def get_playbook():
|
||||
playbooks_path = Path(__file__).parent.parent
|
||||
with open(os.path.join(playbooks_path, "molecule.yml"), "r") as yamlfile:
|
||||
data = yaml.load(yamlfile, Loader=yaml.FullLoader)
|
||||
if "playbooks" in data["provisioner"].keys():
|
||||
if "converge" in data["provisioner"]["playbooks"].keys():
|
||||
return data["provisioner"]["playbooks"]["converge"]
|
||||
else:
|
||||
return os.path.join(playbooks_path, "converge.yml")
|
||||
|
||||
|
||||
def test_ssh_config(host):
|
||||
for vars in read_playbook(get_playbook()):
|
||||
assert host.file(vars["ssh_bastion_confing__name"]).exists
|
||||
assert host.file(vars["ssh_bastion_confing__name"]).is_file
|
||||
Reference in New Issue
Block a user