Merge "ansible-lint: fix error 504"
This commit is contained in:
commit
640f92743f
@ -3,7 +3,6 @@ skip_list:
|
|||||||
- '208' # File permissions not mentioned
|
- '208' # File permissions not mentioned
|
||||||
- '301' # Commands should not change things if nothing needs doing
|
- '301' # Commands should not change things if nothing needs doing
|
||||||
- '502' # All tasks should be named
|
- '502' # All tasks should be named
|
||||||
- '504' # Do not use 'local_action', use 'delegate_to: localhost'
|
|
||||||
- '601' # Don't compare to literal True/False
|
- '601' # Don't compare to literal True/False
|
||||||
- '602' # Don't compare to empty string
|
- '602' # Don't compare to empty string
|
||||||
- '701' # meta/main.yml should contain relevant info
|
- '701' # meta/main.yml should contain relevant info
|
||||||
|
@ -13,13 +13,17 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
---
|
---
|
||||||
- name: "Defined ssh_public_key_path - Check to see if there is a file where the ssh_public_key_path is defined"
|
- name: "Defined ssh_public_key_path - Check to see if there is a file where the ssh_public_key_path is defined"
|
||||||
local_action: stat path={{ ssh_public_key_path }}
|
stat:
|
||||||
|
path: "{{ ssh_public_key_path }}"
|
||||||
register: test_ssh_public_key_path
|
register: test_ssh_public_key_path
|
||||||
when: ssh_public_key_path is defined
|
when: ssh_public_key_path is defined
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid"
|
- name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid"
|
||||||
local_action: fail msg="ssh_public_key_path is not valid."
|
fail:
|
||||||
|
msg: "ssh_public_key_path is not valid."
|
||||||
when: test_ssh_public_key_path.stat.exists == false
|
when: test_ssh_public_key_path.stat.exists == false
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: "Defined ssh_public_key_path - Read SSH public key in"
|
- name: "Defined ssh_public_key_path - Read SSH public key in"
|
||||||
set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}"
|
set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}"
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
---
|
---
|
||||||
- name: "Defined ssh_private_key_path - Check to see if there is a file where the ssh_private_key_path is defined"
|
- name: "Defined ssh_private_key_path - Check to see if there is a file where the ssh_private_key_path is defined"
|
||||||
local_action: stat path={{ ssh_private_key_path }}
|
stat:
|
||||||
|
path: "{{ ssh_private_key_path }}"
|
||||||
register: test_ssh_private_key_path
|
register: test_ssh_private_key_path
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: "Defined ssh_private_key_path - Error if ssh_private_key_path is not valid"
|
- name: "Defined ssh_private_key_path - Error if ssh_private_key_path is not valid"
|
||||||
local_action: fail msg="ssh_private_key_path is not valid."
|
fail:
|
||||||
|
msg: "ssh_private_key_path is not valid."
|
||||||
when: test_ssh_private_key_path.stat.exists == false
|
when: test_ssh_private_key_path.stat.exists == false
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: "Defined ssh_private_key_path - Read SSH private key in"
|
- name: "Defined ssh_private_key_path - Read SSH private key in"
|
||||||
set_fact: ssh_private_key="{{ lookup('file', ssh_private_key_path ) }}"
|
set_fact: ssh_private_key="{{ lookup('file', ssh_private_key_path ) }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user