Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 7ea49b9

Browse files
committed
Hide ansible deprecation warnings in regular provision mode
1 parent 66be4d1 commit 7ea49b9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Vagrantfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ vconfig = load_config([
2929

3030
provisioner = vconfig['force_ansible_local'] ? :ansible_local : vagrant_provisioner
3131
if provisioner == :ansible
32-
playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml"
32+
provisioning_dir = "#{host_drupalvm_dir}/provisioning"
3333
config_dir = host_config_dir
3434

3535
# Verify Ansible version requirement.
3636
require_ansible_version ">= #{vconfig['drupalvm_ansible_version_min']}"
3737
else
38-
playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
38+
provisioning_dir = "#{guest_drupalvm_dir}/provisioning"
3939
config_dir = guest_config_dir
4040
end
4141

@@ -106,14 +106,17 @@ Vagrant.configure('2') do |config|
106106

107107
config.vm.provision 'drupalvm', type: provisioner do |ansible|
108108
ansible.compatibility_mode = '2.0'
109-
ansible.playbook = playbook
109+
ansible.playbook = "#{provisioning_dir}/playbook.yml"
110110
ansible.extra_vars = {
111111
config_dir: config_dir,
112112
drupalvm_env: drupalvm_env
113113
}
114114
ansible.raw_arguments = Shellwords.shellsplit(ENV['DRUPALVM_ANSIBLE_ARGS']) if ENV['DRUPALVM_ANSIBLE_ARGS']
115115
ansible.tags = ENV['DRUPALVM_ANSIBLE_TAGS']
116116
ansible.verbose = ENV['DRUPALVM_DEBUG']
117+
unless ENV['ANSIBLE_CONFIG']
118+
ansible.config_file = "#{provisioning_dir}/ansible#{'.debug' if ENV['DRUPALVM_DEBUG']}.cfg"
119+
end
117120
# Use pip to get the latest Ansible version when using ansible_local.
118121
provisioner == :ansible_local && ansible.install_mode = 'pip'
119122
end

provisioning/ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[defaults]
22
roles_path = ./roles
3+
deprecation_warnings = False
34

45
[ssh_connection]
56
pipelining = True

provisioning/ansible.debug.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[defaults]
2+
roles_path = ./roles
3+
4+
[ssh_connection]
5+
pipelining = True

0 commit comments

Comments
 (0)