# Ansible and kube-deploy

**URL:** <https://forum.ansible.com/t/ansible-and-kube-deploy/22560>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [September 15, 2016, 4:53pm UTC](https://forum.ansible.com/t/ansible-and-kube-deploy/22560 "2016-09-15T16:53:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_Dumont](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Laurent\_Dumont](https://forum.ansible.com/u/Laurent_Dumont)\
**Post date:** [September 15, 2016, 4:53pm UTC](https://forum.ansible.com/t/ansible-and-kube-deploy/22560/1 "2016-09-15T16:53:11Z")

</div>

Hi,

I’m trying to integrate Ansible into kube-deploy to allow for a faster and smoother deployment. I’ve ran into a strange issue where if I’m running the script for the ansible playbook, I cant mount gluster volumes in pods. But, if I run the worker.sh/master.sh locally as root (or with sudo) everything seems to work fine.

Here is an example of the Ansible playbook for a master node. In theory, everything should run under the root user with the correct ENV variables.

> ```auto
> - name: Download the kube-deploy files
> git: repo=https://github.com/kubernetes/kube-deploy.git dest=/opt/kube-deploy version=master
> 
> - name: Run the master deploy script
> shell: echo Y | ./master.sh
> args:
> chdir: /opt/kube-deploy/docker-multinode/
> environment:
> USE_CNI: true
> USE_CONTAINERIZED: true
> K8S_VERSION: v1.4.0-alpha.2
> 
> ```

And here is the actual task definition

> ```auto
> ---
> - hosts: k8-master
> become: yes
> become_method: sudo
> gather_facts: yes
> roles:
> #- common
> - master
> 
> ```

As an aside, I’ve tried using the command module instead of shell, removing the chdir, removing the “echo Y” and directly removing the /var/lib/kubelet folder without success. If a master/worker is started from Ansible, it cannot mount a glusterFS volume target. It seems to be related to the mounting of the root volume from USE\_CONTAINERIZED? I’m using that flag since a Glusterfs volume target would fail without it.
