티스토리 뷰
반응형
엔서블 사용할 전용 유저를 sudoers에 nopasswd유저로 등록 하면 "become: true"를 사용하면 root로 실행이 불가능 할 시에 일반 유저를 사용 주체로 만들고 sudo를 사용하게 하면 일반유저로도 엔서블을 이용한 제어가 가능하다.
---
- hosts: all
become: true
tasks:
- name: ansible user nopassword sudo set
lineinfile:
path: /etc/sudoers
line: "fendys ALL=(ALL) NOPASSWD: ALL"
state: present
backup: yes
# check_mode: yes -> 체크 모드는 확인만 하고 적용은 하지 않는다

* hostallow 추가 내역
---
- name: add hosts.allow BIDC NEW Chakra
lineinfile:
path: /etc/hosts.allow
state: present
line: '{{ item }}'
backup: yes
with_items:
- "#### add new line ###"
- "sshd : 192.168.0.1,192.168.0.2"
반응형
'ansible' 카테고리의 다른 글
ansible key copy (0) | 2021.08.05 |
---|---|
[ansible] file 내용 변경하기 (0) | 2020.02.22 |
[Ansible] How to ansible install (0) | 2019.11.22 |
[Ansible] file modify (0) | 2019.08.01 |
[Ansible] userdel on linux (0) | 2019.07.19 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- cmd로 윈도우 계정 관리
- shell connmad log
- vm rac
- 윈도우 cmd 계정 관리
- ipmi
- CentOS 7 GUI
- ansible ios
- oracle linux8 kernel
- cisco ansible
- 리눅스 커맨드 로그남기기
- windows.old 강제삭제
- centos7 ntp
- ansible network
- 윈도우서버 계정 관려
- ios ansible
- nutanix rac
- cmd로 계정 생성
- cgroup
- 특정 문구 치환
- dl20 centos7
- dl20
- linux command log
- DL20 GEN9 장비에 CentOS 7
- nxos ansible
- ILO
- chrony
- dl20 g9 centos7 설치
- ISCSI 볼륨 RAC
- kernel 변경
- 특정 라인삭제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함