Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,13 @@ $(KDEVOPS_HOSTS): .config ansible.cfg $(KDEVOPS_HOSTS_TEMPLATE)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml

DEFAULT_DEPS += $(KDEVOPS_NODES)
$(KDEVOPS_NODES) $(KDEVOPS_VAGRANT): .config ansible.cfg $(KDEVOPS_NODES_TEMPLATE)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml

DEFAULT_DEPS += $(LOCALHOST_SETUP_WORK)
Expand Down
4 changes: 0 additions & 4 deletions Makefile.build_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,27 @@ qemu: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml
PHONY += qemu

qemu-install: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml --tags vars,install
PHONY += qemu-install

qemu-configure: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml --tags vars,configure
PHONY += qemu-configure

qemu-build: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml --tags vars,build
PHONY += qemu-build

Expand Down
1 change: 0 additions & 1 deletion Makefile.hypervisor-tunings
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ kdevops_hypervisor_tunning: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/hypervisor-tuning.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml
PHONY += kdevops_hypervisor_tunning

Expand Down
21 changes: 7 additions & 14 deletions Makefile.kdevops
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,24 @@ PHONY := kdevops_all
kdevops_terraform_deps:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install_terraform.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/install_terraform.yml
PHONY += kdevops_terraform_deps

kdevops_vagrant_install_vagrant:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant.yml

kdevops_install_libvirt:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "skip_configuration=True" \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "skip_configuration=True"

kdevops_configure_libvirt:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "skip_install=True" \
-e 'running_user=$(USER)' \
-e 'ansible_python_interpreter=/usr/bin/python3'
-e 'running_user=$(USER)'

kdevops_vagrant_deps: \
kdevops_vagrant_install_vagrant \
Expand All @@ -45,25 +41,22 @@ KDEVOPS_VAGRANT_WORK := kdevops_vagrant_deps
kdevops_vagrant_boxes:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant_boxes.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant_boxes.yml
PHONY += kdevops_vagrant_boxes
KDEVOPS_VAGRANT_WORK += kdevops_vagrant_boxes

kdevops_verify_libvirt_user:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "only_verify_user=True" \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "only_verify_user=True"

PHONY += kdevops_verify_libvirt_user
KDEVOPS_VAGRANT_WORK += kdevops_verify_libvirt_user

kdevops_libvirt_storage_pool_create:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_storage_pool_create.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_storage_pool_create.yml

PHONY += kdevops_libvirt_storage_pool_create
KDEVOPS_VAGRANT_WORK += kdevops_libvirt_storage_pool_create
Expand Down
2 changes: 0 additions & 2 deletions Makefile.linux-mirror
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ kdevops_linux_mirror: $(KDEVOPS_EXTRA_VARS)
--inventory localhost, \
--tags vars,mirror \
$(KDEVOPS_PLAYBOOKS_DIR)/linux-mirror.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml
PHONY += kdevops_linux_mirror

Expand All @@ -42,7 +41,6 @@ mirror-status: $(KDEVOPS_EXTRA_VARS)
--inventory localhost, \
--tags vars,mirror-status \
$(KDEVOPS_PLAYBOOKS_DIR)/linux-mirror.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml

PHONY += mirror-status
Expand Down
1 change: 0 additions & 1 deletion Makefile.postfix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ kdevops_postfix_setup_relay: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/postfix_relay_host.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml
PHONY += kdevos_postfix_setup_relay
ANSIBLE_EXTRA_ARGS += $(POSTFIX_SETUP_ARGS)
Expand Down
1 change: 1 addition & 0 deletions empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty
64 changes: 64 additions & 0 deletions kconfigs/Kconfig.ansible_cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI
bool
default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_CALLBACK_PLUGIN)

config ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI
bool
default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_INTERPRETER_PYTHON)

menu "Ansible Callback Plugin Configuration"
choice
prompt "Ansible Callback Plugin"
Expand Down Expand Up @@ -108,6 +112,66 @@ config ANSIBLE_CFG_DEPRECATION_WARNINGS
Toggle to control the showing of deprecation warnings
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#deprecation-warnings

menu "Ansible Python Interpreter"
choice
prompt "Ansible Python Interpreter"
default ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_SILENT if !ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI
default ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM if ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI

config ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO
bool "Ansible Python Interpreter: Auto"
help
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery

config ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_LEGACY
bool "Ansible Python Interpreter: Auto Legacy"
help
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery

config ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_LEGACY_CLIENT
bool "Ansible Python Interpreter: Auto Legacy Client"
help
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery

config ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_SILENT
bool "Ansible Python Interpreter: Auto Silent"
help
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery

config ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM
bool "Ansible Python Interpreter: Custom"
help
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery

endchoice

if ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM

config ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM_NAME
string "Custom Ansible Python Interpreter Name"
default $(shell, ./scripts/append-makefile-vars.sh $(ANSIBLE_CFG_INTERPRETER_PYTHON)) if ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI
default "/usr/bin/env python3" if !ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI

endif # ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM

config ANSIBLE_CFG_INTERPRETER_PYTHON_STRING
string
output yaml
default "auto" if ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO
default "auto_legacy" if ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_LEGACY
default "auto_legacy_client" if ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_LEGACY_CLIENT
default "auto_silent" if ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO_SILENT
default ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM_NAME if ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM
help
Path to the Python interpreter to be used for module execution on remote targets,
or an automatic discovery mode.
https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html#using-python-3-on-the-managed-machines-with-commands-and-playbooks
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html#interpreter-discovery
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#interpreter-python
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#envvar-ANSIBLE_PYTHON_INTERPRETER

endmenu

if DISTRO_OPENSUSE

config ANSIBLE_CFG_RECONNECTION_RETRIES
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/ansible_cfg/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ ansible_cfg_callback_plugin_display_skipped_hosts: true
ansible_cfg_callback_plugin_show_custom_stats: false
ansible_cfg_callback_plugin_show_per_host_start: true
ansible_cfg_callback_plugin_show_task_path_on_failure: true
ansible_cfg_interpreter_python: "auto_silent"
1 change: 1 addition & 0 deletions playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ display_skipped_hosts = {{ ansible_cfg_callback_plugin_display_skipped_hosts }}
show_custom_stats = {{ ansible_cfg_callback_plugin_show_custom_stats }}
show_per_host_start = {{ ansible_cfg_callback_plugin_show_per_host_start }}
show_task_path_on_failure = {{ ansible_cfg_callback_plugin_show_task_path_on_failure }}
interpreter_python = {{ ansible_cfg_interpreter_python_string }}
{% if ansible_facts['distribution'] == 'openSUSE' %}
[connection]
retries = {{ ansible_cfg_reconnection_retries }}
Expand Down
1 change: 0 additions & 1 deletion scripts/archive.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ci-archive:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/kdevops_archive.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars '{ $(ARCHIVE_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml
endif
3 changes: 1 addition & 2 deletions scripts/dynamic-pci-kconfig.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ dynamic_pcipassthrough_kconfig:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/gen-pci-kconfig.yml \
--extra-vars '{ $(PCIE_RUNTIME_VARS) }' \
-e 'ansible_python_interpreter=/usr/bin/python3'
--extra-vars '{ $(PCIE_RUNTIME_VARS) }'

dynamic-kconfig-pci-help:
@echo "dynconfig-pci - enables only pci dynamically generated kconfig content"
Expand Down
14 changes: 5 additions & 9 deletions scripts/guestfs.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,41 +54,37 @@ KDEVOPS_PROVISION_DESTROY_METHOD := destroy_guestfs
libvirt_pcie_passthrough_permissions:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/libvirt_pcie_passthrough.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
playbooks/libvirt_pcie_passthrough.yml

$(KDEVOPS_PROVISIONED_SSH):
$(Q)if [[ "$(CONFIG_KDEVOPS_SSH_CONFIG_UPDATE)" == "y" ]]; then \
ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/update_ssh_config_guestfs.yml \
--extra-vars=@./extra_vars.yaml \
-e 'ansible_python_interpreter=/usr/bin/python3' ;\
LIBVIRT_DEFAULT_URI=$(CONFIG_LIBVIRT_URI) $(TOPDIR)/scripts/update_ssh_config_guestfs.py; \
--extra-vars=@./extra_vars.yaml; \
LIBVIRT_DEFAULT_URI=$(CONFIG_LIBVIRT_URI) \
$(TOPDIR)/scripts/update_ssh_config_guestfs.py; \
fi
$(Q)ansible $(ANSIBLE_VERBOSE) -i hosts all -e 'ansible_python_interpreter=/usr/bin/python3' -m wait_for_connection
$(Q)ansible $(ANSIBLE_VERBOSE) -i hosts all -m wait_for_connection
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)

install_libguestfs:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/bringup_guestfs.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml \
--tags install-deps

bringup_guestfs: $(GUESTFS_BRINGUP_DEPS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/bringup_guestfs.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml \
--tags config-check,network,storage-pool-path
$(Q)$(TOPDIR)/scripts/bringup_guestfs.sh
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/bringup_guestfs.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml \
--tags console-permissions
PHONY += bringup_guestfs
Expand Down
1 change: 0 additions & 1 deletion scripts/install-menuconfig-deps.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ menuconfig-deps:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install-menuconfig-deps.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
-e 'kdevops_first_run=True'
PHONY += menuconfig-deps

Expand Down
3 changes: 1 addition & 2 deletions scripts/journal-server.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ journal-client:
journal-server:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_journal_remote.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_journal_remote.yml

journal-restart:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
Expand Down
1 change: 1 addition & 0 deletions scripts/kconfig-ansible.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 1 addition & 2 deletions scripts/systemd-timesync.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ timesyncd-client:
timesyncd-server:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_timesyncd.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_timesyncd.yml

timesyncd-status:
$(Q)timedatectl status
Expand Down
8 changes: 2 additions & 6 deletions scripts/terraform.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,13 @@ bringup_terraform:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
--connection=local --inventory localhost, \
playbooks/terraform.yml --tags bringup \
--extra-vars=@./extra_vars.yaml \
-e 'ansible_python_interpreter=/usr/bin/python3'
--extra-vars=@./extra_vars.yaml

$(KDEVOPS_PROVISIONED_SSH):
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
-i $(KDEVOPS_HOSTFILE) \
playbooks/terraform.yml --tags ssh \
--extra-vars=@./extra_vars.yaml \
-e 'ansible_python_interpreter=/usr/bin/python3'
--extra-vars=@./extra_vars.yaml
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)

status_terraform:
Expand All @@ -154,12 +152,10 @@ destroy_terraform:
--connection=local -i $(KDEVOPS_HOSTFILE) \
playbooks/terraform.yml --tags destroy \
--extra-vars=@./extra_vars.yaml \
-e 'ansible_python_interpreter=/usr/bin/python3'
$(Q)rm -f $(KDEVOPS_PROVISIONED_SSH) $(KDEVOPS_PROVISIONED_DEVCONFIG)

$(KDEVOPS_TFVARS): $(KDEVOPS_TFVARS_TEMPLATE) .config
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_tfvars.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' \
--extra-vars=@./extra_vars.yaml
6 changes: 2 additions & 4 deletions scripts/vagrant.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,13 @@ vagrant_9p_linux_clone:
libvirt_pcie_passthrough_permissions:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/libvirt_pcie_passthrough.yml \
-e 'ansible_python_interpreter=/usr/bin/python3'
playbooks/libvirt_pcie_passthrough.yml

$(KDEVOPS_PROVISIONED_SSH):
$(Q)if [[ "$(CONFIG_KDEVOPS_SSH_CONFIG_UPDATE)" == "y" ]]; then \
ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
--inventory localhost, \
playbooks/update_ssh_config_vagrant.yml \
-e 'ansible_python_interpreter=/usr/bin/python3' ;\
playbooks/update_ssh_config_vagrant.yml
fi
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)

Expand Down