Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with latest ansible. #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ galaxy_info:
- name: EL
versions:
- 7
- 8
- name: Debian
versions:
- stretch
Expand Down
24 changes: 14 additions & 10 deletions tasks/Darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,21 @@

- name: Add deployment group tags
set_fact:
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args + ['--addDeploymentGroupTags', '--deploymentGroupTags', az_devops_deployment_group_tags'] }}"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Set proxy
- name: Set proxy url
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'',
'--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl', az_devops_proxy_url] }}"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Set proxy username and password
set_fact:
agent_cmd_args: "{{ agent_cmd_args + ['--proxyusername', az_devops_proxy_username, '--proxypassword', az_devops_proxy_password] }}"
when:
- az_devops_proxy_url is defined and az_devops_proxy_url != None and az_devops_proxy_username != None and az_devops_proxy_password != None

- name: Uninstall agent service
command: ./svc.sh uninstall
Expand All @@ -125,9 +129,9 @@

- name: Add '--replace' configuration argument
set_fact:
build_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
deployment_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
resource_agent_cmd_args: "{{ resource_agent_cmd_args }} + ['--replace']"
build_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
deployment_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
resource_agent_cmd_args: "{{ resource_agent_cmd_args + ['--replace'] }}"
when:
- az_devops_agent_replace_existing

Expand Down
37 changes: 26 additions & 11 deletions tasks/Linux.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- name: Create group {{ az_devops_agent_group }}
group:
name: "{{ az_devops_agent_group }}"
state: present

- name: Add an agent user
user:
name: "{{ az_devops_agent_user }}"
Expand Down Expand Up @@ -94,20 +99,30 @@

- name: Add deployment group tags
set_fact:
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args + ['--addDeploymentGroupTags', '--deploymentGroupTags', az_devops_deployment_group_tags ] }}"
when:
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Set proxy url
set_fact:
agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl', az_devops_proxy_url] }}"
when:
- az_devops_deployment_group_tags is defined
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Set proxy
- name: Set proxy user and password
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'', '--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
agent_cmd_args: "{{ agent_cmd_args + ['--proxyusername', az_devops_proxy_username, '--proxypassword', az_devops_proxy_password ] }}"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url != None and az_devops_proxy_username != None and az_devops_proxy_password != None

- name: Download {{ az_devops_agent_package_url }}
get_url:
url: "{{ az_devops_agent_package_url }}"
dest: "/tmp/az_devops_agent_package.tar.gz"

- name: Download and unarchive
- name: Unarchive /tmp/az_devops_agent_package.tar.gz
unarchive:
src: "{{ az_devops_agent_package_url }}"
src: "/tmp/az_devops_agent_package.tar.gz"
dest: "{{ az_devops_agent_folder }}"
remote_src: yes
owner: "{{ az_devops_agent_user }}"
Expand Down Expand Up @@ -139,9 +154,9 @@

- name: Add '--replace' configuration argument
set_fact:
build_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
deployment_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
resource_agent_cmd_args: "{{ resource_agent_cmd_args }} + ['--replace']"
build_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
deployment_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
resource_agent_cmd_args: "{{ resource_agent_cmd_args + ['--replace'] }}"
when:
- az_devops_agent_replace_existing

Expand Down
26 changes: 13 additions & 13 deletions tasks/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
become: yes
when:
- az_devops_agent_create_local_user

- name: Ensure chocolatey is present
win_chocolatey:
name: chocolatey
Expand Down Expand Up @@ -42,49 +42,49 @@

- name: Add '/Replace' configuration argument
set_fact:
common_install_options: "{{ common_install_options }} + ['/Replace']"
common_install_options: "{{ common_install_options + ['/Replace'] }}"
when:
- az_devops_agent_replace_existing

- name: Add deployment group tags
set_fact:
deployment_install_options: "{{ deployment_install_options }} + ['/DeploymentGroupTags:{{ az_devops_deployment_group_tags }}']"
deployment_install_options: "{{ deployment_install_options + ['/DeploymentGroupTags:{{ az_devops_deployment_group_tags }}'] }}"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Add az_devops_proxy_url
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyUrl:{{ az_devops_proxy_url }}']"
common_install_options: "{{ common_install_options + ['/ProxyUrl:{{ az_devops_proxy_url }}'] }}"
when:
- az_devops_proxy_url is defined and az_devops_proxy_url
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Add az_devops_proxy_username
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyUserName:{{ az_devops_proxy_username }}']"
common_install_options: "{{ common_install_options + ['/ProxyUserName:{{ az_devops_proxy_username }}'] }}"
when:
- az_devops_proxy_username is defined and az_devops_proxy_username
- az_devops_proxy_username is defined and az_devops_proxy_username != None

- name: Add az_devops_proxy_password
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyPassword:{{ az_devops_proxy_password }}']"
common_install_options: "{{ common_install_options + ['/ProxyPassword:{{ az_devops_proxy_password }}'] }}"
when:
- az_devops_proxy_password is defined and az_devops_proxy_password
- az_devops_proxy_password is defined and az_devops_proxy_password != None

- name: Configure agent as a build server
set_fact:
az_devops_agent_package_params: "{{ common_install_options }} + {{ build_agent_install_options }}"
az_devops_agent_package_params: "{{ common_install_options + build_agent_install_options }}"
when:
- az_devops_agent_role == 'build'

- name: Configure agent as a deployment server
set_fact:
az_devops_agent_package_params: "{{ common_install_options }} + {{ deployment_install_options }}"
az_devops_agent_package_params: "{{ common_install_options + deployment_install_options }}"
when:
- az_devops_agent_role == 'deployment'

- name: Configure agent as an environment resource
set_fact:
az_devops_agent_package_params: "{{ common_install_options }} + {{ resource_agent_install_options }}"
az_devops_agent_package_params: "{{ common_install_options + resource_agent_install_options }}"
when:
- az_devops_agent_role == 'resource'

Expand Down
8 changes: 8 additions & 0 deletions vars/dependencies-RedHat-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
az_devops_agent_dependencies:
- krb5-libs
- libicu
- lttng-ust
- openssl-libs
- zlib
# mine only found the script install libicu lttng-ust userspace-rcu
- userspace-rcu