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

Commit

Permalink
Hide ansible deprecation warnings in regular provision mode
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyc committed Dec 29, 2018
1 parent 66be4d1 commit 7ea49b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ vconfig = load_config([

provisioner = vconfig['force_ansible_local'] ? :ansible_local : vagrant_provisioner
if provisioner == :ansible
playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml"
provisioning_dir = "#{host_drupalvm_dir}/provisioning"
config_dir = host_config_dir

# Verify Ansible version requirement.
require_ansible_version ">= #{vconfig['drupalvm_ansible_version_min']}"
else
playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
provisioning_dir = "#{guest_drupalvm_dir}/provisioning"
config_dir = guest_config_dir
end

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

config.vm.provision 'drupalvm', type: provisioner do |ansible|
ansible.compatibility_mode = '2.0'
ansible.playbook = playbook
ansible.playbook = "#{provisioning_dir}/playbook.yml"
ansible.extra_vars = {
config_dir: config_dir,
drupalvm_env: drupalvm_env
}
ansible.raw_arguments = Shellwords.shellsplit(ENV['DRUPALVM_ANSIBLE_ARGS']) if ENV['DRUPALVM_ANSIBLE_ARGS']
ansible.tags = ENV['DRUPALVM_ANSIBLE_TAGS']
ansible.verbose = ENV['DRUPALVM_DEBUG']
unless ENV['ANSIBLE_CONFIG']
ansible.config_file = "#{provisioning_dir}/ansible#{'.debug' if ENV['DRUPALVM_DEBUG']}.cfg"
end
# Use pip to get the latest Ansible version when using ansible_local.
provisioner == :ansible_local && ansible.install_mode = 'pip'
end
Expand Down
1 change: 1 addition & 0 deletions provisioning/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[defaults]
roles_path = ./roles
deprecation_warnings = False

[ssh_connection]
pipelining = True
5 changes: 5 additions & 0 deletions provisioning/ansible.debug.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[defaults]
roles_path = ./roles

[ssh_connection]
pipelining = True

0 comments on commit 7ea49b9

Please sign in to comment.