Ansible에서 서버 인증서 정보 보고서를 작성해 보았습니다.
                                            
                                                
                                                
                                                
                                                
                                                
                                                 7171 단어  Ansiblecertificate
                    
Ansible Server Certificate Report Generator
 htps : // 기주 b. 코 m / 스카이 죠케 r / 안시 b ぇ - r r
 환경
품목
버전
CentOS
7.6
 사용법
 클론
리포지토리를 복제합니다.
[root@b3b24c5352f8 ~]# git clone https://github.com/sky-joker/ansible-server-certificate-report-generator.git
 설치
ansible 및 필요한 python 모듈을 설치합니다.
[root@b3b24c5352f8 ~]# cd ansible-server-certificate-report-generator/
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# pip install -r requirements.txt
 Playbook 만들기
Playbook을 만듭니다.
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# vi main.yml
서버 인증서 정보를 검색하려는 서버의 FQDN 또는 IP 주소를 servers 변수에 추가합니다.
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
프록시를 사용하는 경우 다음과 같이 옵션을 추가합니다.
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
        proxy_host: 192.168.1.1
        proxy_port: 3128 # defaultは 8080
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
 Playbook 실행
Playbook을 실행합니다.
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# ansible-playbook main.yml
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Generate of server certificate report] *******************************************************************************************************************************
TASK [Get certificate information from server.] ****************************************************************************************************************************
ok: [localhost] => (item=www.example.com)
ok: [localhost] => (item=www.yahoo.co.jp)
ok: [localhost] => (item=github.com)
TASK [Generate report.] ****************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *****************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
 보고서 확인
문제없이 실행이 완료되면 Playbook을 실행 한 디렉토리에 server_certificate_report.html가 작성되었으므로 브라우저에서 열립니다.
 
이런 식으로 보고서를 만들 수 있습니다 :)
다른 사용법으로서는, 증명서의 갱신을 자동화한 후에 제대로 갱신되고 있는지 확인하는 테스트로서도 사용할 수 있을 것 같네요!
모두 행복한 자동화!
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(Ansible에서 서버 인증서 정보 보고서를 작성해 보았습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/sky_jokerxx/items/6a9f850a41f0f09de495
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
품목
버전
CentOS
7.6
사용법
 클론
리포지토리를 복제합니다.
[root@b3b24c5352f8 ~]# git clone https://github.com/sky-joker/ansible-server-certificate-report-generator.git
 설치
ansible 및 필요한 python 모듈을 설치합니다.
[root@b3b24c5352f8 ~]# cd ansible-server-certificate-report-generator/
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# pip install -r requirements.txt
 Playbook 만들기
Playbook을 만듭니다.
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# vi main.yml
서버 인증서 정보를 검색하려는 서버의 FQDN 또는 IP 주소를 servers 변수에 추가합니다.
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
프록시를 사용하는 경우 다음과 같이 옵션을 추가합니다.
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
        proxy_host: 192.168.1.1
        proxy_port: 3128 # defaultは 8080
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
 Playbook 실행
Playbook을 실행합니다.
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# ansible-playbook main.yml
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Generate of server certificate report] *******************************************************************************************************************************
TASK [Get certificate information from server.] ****************************************************************************************************************************
ok: [localhost] => (item=www.example.com)
ok: [localhost] => (item=www.yahoo.co.jp)
ok: [localhost] => (item=github.com)
TASK [Generate report.] ****************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *****************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
 보고서 확인
문제없이 실행이 완료되면 Playbook을 실행 한 디렉토리에 server_certificate_report.html가 작성되었으므로 브라우저에서 열립니다.
 
이런 식으로 보고서를 만들 수 있습니다 :)
다른 사용법으로서는, 증명서의 갱신을 자동화한 후에 제대로 갱신되고 있는지 확인하는 테스트로서도 사용할 수 있을 것 같네요!
모두 행복한 자동화!
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(Ansible에서 서버 인증서 정보 보고서를 작성해 보았습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/sky_jokerxx/items/6a9f850a41f0f09de495
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
[root@b3b24c5352f8 ~]# git clone https://github.com/sky-joker/ansible-server-certificate-report-generator.git
[root@b3b24c5352f8 ~]# cd ansible-server-certificate-report-generator/
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# pip install -r requirements.txt
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# vi main.yml
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
---
- name: Generate of server certificate report
  hosts: localhost
  gather_facts: no
  vars:
    servers:
      - www.example.com
      - www.yahoo.co.jp
      - github.com
  tasks:
    - name: Get certificate information from server.
      server_certificate_info:
        server: "{{ item }}"
        proxy_host: 192.168.1.1
        proxy_port: 3128 # defaultは 8080
      loop: "{{ servers }}"
      register: certificate_result
    - name: Generate report.
      template:
        src: templates/server_certificate_report.j2
        dest: server_certificate_report.html
[root@b3b24c5352f8 ansible-server-certificate-report-generator]# ansible-playbook main.yml
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Generate of server certificate report] *******************************************************************************************************************************
TASK [Get certificate information from server.] ****************************************************************************************************************************
ok: [localhost] => (item=www.example.com)
ok: [localhost] => (item=www.yahoo.co.jp)
ok: [localhost] => (item=github.com)
TASK [Generate report.] ****************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *****************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
문제없이 실행이 완료되면 Playbook을 실행 한 디렉토리에
server_certificate_report.html가 작성되었으므로 브라우저에서 열립니다.
이런 식으로 보고서를 만들 수 있습니다 :)
다른 사용법으로서는, 증명서의 갱신을 자동화한 후에 제대로 갱신되고 있는지 확인하는 테스트로서도 사용할 수 있을 것 같네요!
모두 행복한 자동화!
Reference
이 문제에 관하여(Ansible에서 서버 인증서 정보 보고서를 작성해 보았습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/sky_jokerxx/items/6a9f850a41f0f09de495텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)