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

Commit c89a9bc

Browse files
committed
Hide ansible deprecation warnings in regular provision mode
1 parent 57e9200 commit c89a9bc

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,10 +29,10 @@ 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
else
35-
playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
35+
provisioning_dir = "#{guest_drupalvm_dir}/provisioning"
3636
config_dir = guest_config_dir
3737
end
3838

@@ -103,14 +103,17 @@ Vagrant.configure('2') do |config|
103103
end
104104

105105
config.vm.provision provisioner do |ansible|
106-
ansible.playbook = playbook
106+
ansible.playbook = "#{provisioning_dir}/playbook.yml"
107107
ansible.extra_vars = {
108108
config_dir: config_dir,
109109
drupalvm_env: drupalvm_env
110110
}
111111
ansible.raw_arguments = Shellwords.shellsplit(ENV['DRUPALVM_ANSIBLE_ARGS']) if ENV['DRUPALVM_ANSIBLE_ARGS']
112112
ansible.tags = ENV['DRUPALVM_ANSIBLE_TAGS']
113113
ansible.verbose = ENV['DRUPALVM_DEBUG']
114+
unless ENV['ANSIBLE_CONFIG']
115+
ansible.config_file = "#{provisioning_dir}/ansible#{'.debug' if ENV['DRUPALVM_DEBUG']}.cfg"
116+
end
114117
# Use pip to get the latest Ansible version when using ansible_local.
115118
provisioner == :ansible_local && ansible.install_mode = 'pip'
116119
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)