15 Star 32 Fork 10

乞丐亦异/kubernetes-rook-nexus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
03-patch.yml 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
乞丐亦异 提交于 2019-11-06 11:16 . rebased
- hosts: kube-master
tasks:
- block:
- name: "Current user is '{{ ansible_env.USER }}'"
set_fact:
current_user: "{{ ansible_env.USER }}"
when: ansible_env.USER != 'root'
- name: "Current user is '{{ ansible_env.SUDO_USER }}'"
set_fact:
current_user: "{{ ansible_env.SUDO_USER }}"
when: ansible_env.SUDO_USER is defined
- name: "Create /home/{{ ansible_env.USER }}/.kube"
become_user: "{{ current_user }}"
file:
path: "/home/{{ current_user }}/.kube"
state: directory
mode: 0700
owner: "{{ current_user }}"
group: "{{ current_user }}"
- name: "Create /home/{{ current_user }}/.kube/config"
become: yes
copy:
remote_src: yes
src: /etc/kubernetes/admin.conf
dest: "/home/{{ current_user }}/.kube/config"
mode: 0600
owner: "{{ current_user }}"
group: "{{ current_user }}"
- name: "Initial helm for user '{{ current_user }}'"
become_user: "{{ current_user }}"
command: "{{ item }}"
changed_when: false
with_items:
- "{{ bin_dir }}/helm init --stable-repo-url={{ nexus_repo_charts }} --client-only"
- name: "Assign docker access to {{ current_user }}"
become: yes
user:
name: "{{ current_user }}"
groups: docker
append: yes
when:
- (ansible_env.USER != 'root') or (ansible_env.SUDO_USER is defined)
tags: user_init
- hosts: kube-master
become: yes
roles:
- name: k8s_patches
tags: patches
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/bottlelee/kubernetes-rook-nexus.git
git@gitee.com:bottlelee/kubernetes-rook-nexus.git
bottlelee
kubernetes-rook-nexus
kubernetes-rook-nexus
master

搜索帮助