Add hostpath roles
parent
65e6725f34
commit
47c6cf891f
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- hosts: worker-node
|
||||||
|
name: "HostPath"
|
||||||
|
roles:
|
||||||
|
- role: hostpath
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>This file is on k8s-worker-node2 at /data</h1>
|
||||||
|
|
||||||
|
<p>Hello World!</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
- name: create data dir on K8s-worker-node2
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
path: /data
|
||||||
|
state: directory
|
||||||
|
when: "'K8s-worker-node2' in ansible_facts.hostname"
|
||||||
|
|
||||||
|
- name: copy file on K8s-worker-node2
|
||||||
|
become: yes
|
||||||
|
copy:
|
||||||
|
src: index.html
|
||||||
|
dest: /data/
|
||||||
|
when: "'K8s-worker-node2' in ansible_facts.hostname"
|
||||||
Loading…
Reference in New Issue