본문 바로가기

전체 글226

[powershell] 윈도우 스케줄러 enable/disable 윈도우 스케줄 batch 로 disable enable 하는 방법 powershell Disable-ScheduledTask -TaskName "스케줄명" powershell enable-ScheduledTask -TaskName "스케줄명" 파워쉘 윈도우 스케줄러 enable disable 배치 윈도우 스케줄러 batch windows scheduler enable disable 2022. 8. 2.
[Ansible] 앤서블 와일드카드 find 아스테리크 - hosts: all become: yes vars: ansible_become_password: "{{ sudopasswd }}" tasks: - name: deploy check script copy: src: /data/ansible/file/scripttest.sh dest: /tmp/Unix_v1.3.3_contain_web_was.sh mode: 0755 #user: "infra" - name: exec check script shell: cmd: /tmp/scripttest.sh register: result - name: result debug: msg: "{{ result.stdout_lines }}" - name: find result file find: paths: "/home/in.. 2022. 7. 30.
[Ansible] ansible fetch 앤서블 파일 끌어오기 앤서블이 제어하는 인벤토리 호스트에서의 파일을 끌어오기 위한 플러그인 취약점 결과를 파일로 남겨 앤서블 서버에 결과파일을 업로딩하는 플레이북 --- - hosts: all become: yes vars: ansible_become_password: "{{ sudopasswd }}" tasks: # 인벤토리 호스트의 /root/에 check.sh 스크립트 배포 - name: deploy check script copy: src: /data/ansible/file/check.sh dest: /root/check.sh # 실행을 위한 권한 수정 - name: exec chmod check script shell: cmd: chmod 755 /root/check.sh # check.sh 스크립트 실행&결과 저장.. 2022. 7. 29.
[PHP] FILE UPLOAD DISABLE 파일 업로드 OFF PHP 파일업로드 기능을 disble하고자 한다. php.ini 파일에 아래와같이 설정하고 httpd 서비스를 재시작하면 된다. [PHP] file_uploads = Off php.ini 파일이 존재하지 않는 경우가 있었다. 이경우에는 사용하는 php가 어떤 설정파일을 어디서 읽는지를 알아야 하는데 이경우 아래 명령어를 사용하면 된다. php -i | grep php.ini Loaded Configuration File => /etc/php.ini 간혼 로드되고 있는 php.ini 파일이 없다고도 하는데 이경우 configuration file path에 설정된 폴더에 php.ini를 생성해서 후 서비스 재시작 해주어 적용하면 된다. php file upload 해제 php file upload disa.. 2022. 7. 28.
[Ansible] windows 파일배포 & 압축 해제 윈도우 시스템에 zip파일을 배포 후 압축 해제 함 --- - hosts: all vars: ansible_port: 5985 ansible_connection: winrm ansible_winrm_server_cert_validation: ignore ansible_winrm_scheme: http ansible_winrm_transport: basic tasks: - name: deploy disk mount file win_copy: src: '/data/ansible/file/Disk_Part.ps1' dest: 'c:\Disk_Part.ps1' - name: run powershell win_shell: 'powershell.exe -ExecutionPolicy Bypass -File c:\Di.. 2022. 7. 27.
[powershell] windows 계정 이름 rename 윈도우 계정 이름 rename Rename-LocalUser -Name 'administrator' -NewName '바꿀계정' 2022. 7. 26.
[powershell] 파워쉘 윈도우 계정 패스워드 변경 기존에 있는 계정의 패스워드를 변경할 수 있다. $PASSWORD= ConvertTo-SecureString –AsPlainText -Force -String qlalfqjsgh123! Set-LocalUser -Name "seotest" -Password $PASSWORD powershell windows user password change 파워쉘 패스워드 변경 2022. 7. 26.
[Windows Server]The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements 패스워드가 윈도우 서버에 설정된 패스워드 정책에 대해 만족하지 못해서 발생되는 에러임 확인방법 실행 > secpol.msc > Account policy > password policy에서 계정 패스워드에 대한 정책을 확인할 수 있다. 윈도우 패스워드 정책 windows password 정책 로컬보안정책 secpol.msc 2022. 7. 26.
[Ansible] ansible apt update playbook ansible로 우분투 패키지 설치전 apt update를 수행하고 싶을때 아래와 같이 수행한다. --- - name: install amsclient hosts: all become: yes vars: ansible_become_password: "{{ sudopasswd }}" tasks: - name: apt install ipa-client apt: update_cache: yes force_apt_get: yes cache_valid_time: 3600 앤서블 우분투 apt 업데이트 앤서블 ubuntu apt udpate ansible ubuntu apt udpate 2022. 7. 20.
[Ansible] windows powershell 파일 실행하기 anisble에서 간단한 파워쉘 명령어 실행의 경우 win_shell: "powershell 파워쉘명령어" 로 수행하곤 했다. 하지만 코드가 많은 파워 쉘파일(ps.1)의 경우는? 파워쉘파일은 파일의 절대경로를 써서는 실행이 안되다.(bat파일은 실행 가능) win_command: "powershell.exe -ExecutionPolicy Bypass -File c:\Disk_Part.ps1" 또는 win_shell: "powershell.exe -ExecutionPolicy Bypass -File c:\Disk_Part.ps1" 둘다 테스트 해본 결과 정상적으로 수행 되었고 아래코드는 Disk_part.ps1이라는 파워쉘을 노드에 배포한 뒤 실행을 하는 playbook이다. --- - hosts: al.. 2022. 7. 19.
반응형