Skip to content

Commit

Permalink
Add VAGRANT_ANSIBLE_TAGS for normal deployment
Browse files Browse the repository at this point in the history
Current ansible.tags 'facts' is for skipping actual Kubespray deployment
at vagrant CI because the deployment takes much time. However the static
'facts' skips the deployment for normal usage of vagrant also.
That causes confusions.

This adds VAGRANT_ANSIBLE_TAGS to skip the deployment for vagrant CI.
  • Loading branch information
Kenichi Omichi committed Apr 8, 2022
1 parent 00a4d2d commit 9c87218
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ $local_path_provisioner_claim_root ||= "/opt/local-path-provisioner/"
$libvirt_nested ||= false
# boolean or string (e.g. "-vvv")
$ansible_verbosity ||= false
$ansible_tags ||= ENV['VAGRANT_ANSIBLE_TAGS'] || ""

$playbook ||= "cluster.yml"

Expand Down Expand Up @@ -256,7 +257,9 @@ Vagrant.configure("2") do |config|
ansible.host_key_checking = false
ansible.raw_arguments = ["--forks=#{$num_instances}", "--flush-cache", "-e ansible_become_pass=vagrant"]
ansible.host_vars = host_vars
ansible.tags = ['facts']
if $ansible_tags
ansible.tags = [$ansible_tags]
end
ansible.groups = {
"etcd" => ["#{$instance_name_prefix}-[1:#{$etcd_instances}]"],
"kube_control_plane" => ["#{$instance_name_prefix}-[1:#{$kube_master_instances}]"],
Expand Down
1 change: 1 addition & 0 deletions test-infra/vagrant-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM quay.io/kubespray/kubespray:${KUBESPRAY_VERSION}

ENV VAGRANT_VERSION=2.2.19
ENV VAGRANT_DEFAULT_PROVIDER=libvirt
ENV VAGRANT_ANSIBLE_TAGS=facts

RUN apt-get update && apt-get install -y wget libvirt-dev openssh-client rsync git

Expand Down

0 comments on commit 9c87218

Please sign in to comment.