kairen / kubeadm-ansible

Build a Kubernetes cluster using kubeadm via Ansible.
Apache License 2.0
724 stars 379 forks source link

No access to file error while running the playbook #65

Open karaleina opened 5 years ago

karaleina commented 5 years ago

Hello,

I downloaded this repository. In my case, I use only one node (master node as master and worker node). So, I have such a hosts.ini file:

[master]
172.x.x.5

[kube-cluster:children]
master

[default]
ansible_become=true
ansible_user='<my_user_name>'
ansible_become_method='sudo'
ansible_become_user='kubernetes'

...as I need to log as the sudo, but not root user ('kubernetes' user).

I am getting such an error (console log):

 [WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details

PLAY [kube-cluster] ************************************************************

TASK [Gathering Facts] *********************************************************
Tuesday 16 July 2019  16:40:02 +0200 (0:00:00.023)       0:00:00.023 ********** 
ok: [172.x.x.5]

TASK [commons/os-checker : Get os_version from /etc/os-release] ****************
Tuesday 16 July 2019  16:40:04 +0200 (0:00:02.057)       0:00:02.080 ********** 
skipping: [172.x.x.5]

TASK [commons/os-checker : Get distro name from /etc/os-release] ***************
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.036)       0:00:02.117 ********** 
skipping: [172.x.x.5]

TASK [commons/os-checker : Set fact ansible_os_family var to Debian] ***********
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.036)       0:00:02.153 ********** 
skipping: [172.x.x.5]

TASK [commons/os-checker : Set fact ansible_os_family var to Debian] ***********
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.035)       0:00:02.189 ********** 
skipping: [172.x.x.5]

TASK [commons/os-checker : Set fact ansible_os_family var to RedHat] ***********
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.035)       0:00:02.224 ********** 
skipping: [172.x.x.5]

TASK [commons/os-checker : Override config file directory for Debian] **********
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.034)       0:00:02.259 ********** 
skipping: [172.x.x.5]

TASK [docker : Install Docker container engine] ********************************
Tuesday 16 July 2019  16:40:04 +0200 (0:00:00.034)       0:00:02.294 ********** 
included: /home/user/Pulpit/kubeadm-ansible-master/roles/docker/tasks/pkg.yml for 172.x.x.5

TASK [docker : Install apt-transport-https] ************************************
Tuesday 16 July 2019  16:40:05 +0200 (0:00:00.059)       0:00:02.353 ********** 
skipping: [172.x.x.5]

TASK [docker : Add Docker APT GPG key] *****************************************
Tuesday 16 July 2019  16:40:05 +0200 (0:00:00.034)       0:00:02.388 ********** 
skipping: [172.x.x.5]

TASK [docker : Add Docker APT repository] **************************************
Tuesday 16 July 2019  16:40:05 +0200 (0:00:00.035)       0:00:02.424 ********** 
skipping: [172.x.x.5]

TASK [docker : Add Docker yum repository] **************************************
Tuesday 16 July 2019  16:40:05 +0200 (0:00:00.035)       0:00:02.460 ********** 
fatal: [172.x.x.5]: FAILED! => {"changed": false, "details": "[Errno 13] Access denied: '/etc/yum.repos.d/docker.repo'", "msg": "Cannot open repo file /etc/yum.repos.d/docker.repo."}

PLAY RECAP *********************************************************************
172.x.x.5                 : ok=2    changed=0    unreachable=0    failed=1    skipped=9    rescued=0    ignored=0   

Tuesday 16 July 2019  16:40:05 +0200 (0:00:00.861)       0:00:03.322 ********** 
=============================================================================== 
Gathering Facts --------------------------------------------------------- 2.06s
docker : Add Docker yum repository -------------------------------------- 0.86s
docker : Install Docker container engine -------------------------------- 0.06s
commons/os-checker : Get os_version from /etc/os-release ---------------- 0.04s
commons/os-checker : Get distro name from /etc/os-release --------------- 0.04s
docker : Add Docker APT GPG key ----------------------------------------- 0.04s
commons/os-checker : Set fact ansible_os_family var to Debian ----------- 0.04s
docker : Add Docker APT repository -------------------------------------- 0.04s
commons/os-checker : Set fact ansible_os_family var to Debian ----------- 0.04s
commons/os-checker : Override config file directory for Debian ---------- 0.03s
docker : Install apt-transport-https ------------------------------------ 0.03s
commons/os-checker : Set fact ansible_os_family var to RedHat ----------- 0.03s