githubixx / ansible-role-etcd

Ansible role for installing etcd cluster
https://www.tauceti.blog/post/kubernetes-the-not-so-hard-way-with-ansible-etcd/
GNU General Public License v3.0
51 stars 22 forks source link

Could not find or access '/home/user/k8s/certs/ca-etcd.pem' on the Ansible Controller. #11

Closed patsevanton closed 6 years ago

patsevanton commented 6 years ago

Hi! Try run and get error

TASK [githubixx.etcd : Copy certificates] *******************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: If you are using a module and expect the file to exist on the remote, see the remote_src option
failed: [patroni1] (item=ca-etcd.pem) => {
    "changed": false, 
    "item": "ca-etcd.pem"
}

MSG:

Could not find or access '/home/user/k8s/certs/ca-etcd.pem' on the Ansible Controller.
If you are using a module and expect the file to exist on the remote, see the remote_src option
- hosts: etcd
  roles:
    - githubixx.etcd

Try with become: yes and without become:yes

cat ansible.cfg

[defaults]
inventory = hosts
remote_user = user
host_key_checking = False
stdout_callback=debug
log_path=logfile
cat hosts 
[etcd]
patroni1 ansible_host=192.168.88.197
patroni2 ansible_host=192.168.88.196
patroni3 ansible_host=192.168.88.195
githubixx commented 6 years ago

Hi! You need to create certificate authority (CA) and certificates first. They're needed for secure cluster communication. One possibility is described in my blog post https://www.tauceti.blog/post/kubernetes-the-not-so-hard-way-with-ansible-certificate-authority/ . But you can also use your own CA if you already have one to create your certificates.