question_id int64 88 79.9M | title_clean stringlengths 14 150 | body_clean stringlengths 41 26.5k | full_text stringlengths 63 26.6k | tags stringlengths 4 105 | score int64 3 7.71k | view_count int64 46 12.2M | answer_count int64 0 79 | link stringlengths 56 125 |
|---|---|---|---|---|---|---|---|---|
62,429,760 | Creating ansible inventory for multiple target hosts | I am using terraform to create resources then using templatefile approach to create ansible inventory in yaml language. I am creating multiple Virtual Machines in terraform and configure them using ansible in single pipeline. Issue I am having is yaml file uses - for lists which is giving error in ansible playbook Outp... | Creating ansible inventory for multiple target hosts I am using terraform to create resources then using templatefile approach to create ansible inventory in yaml language. I am creating multiple Virtual Machines in terraform and configure them using ansible in single pipeline. Issue I am having is yaml file uses - for... | json, ansible, yaml, terraform | 6 | 2,819 | 1 | https://stackoverflow.com/questions/62429760/creating-ansible-inventory-for-multiple-target-hosts |
61,959,599 | Modules to create file only if it does not exist and write some data | I need to use Ansible modules to check if a the file exist, and if it doesn't, then create it and write some data in to it. If the file exists then check the content, which I am trying to write, is present in that file. If the content is not present, write the content into it. If the content is present then do nothing.... | Modules to create file only if it does not exist and write some data I need to use Ansible modules to check if a the file exist, and if it doesn't, then create it and write some data in to it. If the file exists then check the content, which I am trying to write, is present in that file. If the content is not present, ... | ansible | 6 | 9,141 | 2 | https://stackoverflow.com/questions/61959599/modules-to-create-file-only-if-it-does-not-exist-and-write-some-data |
61,550,860 | Ansible: Stop and Disable services if they are present | I'm trying to stop and disable a list of services only if they are installed. I'm calling the service_facts module to generate a list of running services and using filter "union" - name: Include variables for Amazon Linux. include_vars: ../vars/test.yml - name: populate service facts service_facts: - name: start the se... | Ansible: Stop and Disable services if they are present I'm trying to stop and disable a list of services only if they are installed. I'm calling the service_facts module to generate a list of running services and using filter "union" - name: Include variables for Amazon Linux. include_vars: ../vars/test.yml - name: pop... | ansible, ansible-2.x | 6 | 23,678 | 1 | https://stackoverflow.com/questions/61550860/ansible-stop-and-disable-services-if-they-are-present |
60,582,220 | How to copy files to container in kubernetes yaml | I understand that files / folders can be copied into a container using the command: kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir However, I am looking to do this in a yaml file How would I go about doing this? (Assuming that I am using a deployment for the container) | How to copy files to container in kubernetes yaml I understand that files / folders can be copied into a container using the command: kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir However, I am looking to do this in a yaml file How would I go about doing this? (Assuming that I am using a deployment for the container) | docker, kubernetes, containers, kubectl, kubernetes-deployment | 6 | 19,938 | 2 | https://stackoverflow.com/questions/60582220/how-to-copy-files-to-container-in-kubernetes-yaml |
59,811,664 | What are good workflows for deploying podman/buildah created container images to minikube? | I am exploring and learning about containers and kubernetes using podman and minikube on a linux workstation. I use podman to build images on the workstation and would like to deploy these images in minikube also running on the workstation using the kvm2 virtual machine driver. I also start minikube using the CRI-O con... | What are good workflows for deploying podman/buildah created container images to minikube? I am exploring and learning about containers and kubernetes using podman and minikube on a linux workstation. I use podman to build images on the workstation and would like to deploy these images in minikube also running on the w... | minikube, kvm, podman, cri-o | 6 | 979 | 1 | https://stackoverflow.com/questions/59811664/what-are-good-workflows-for-deploying-podman-buildah-created-container-images-to |
59,779,075 | How to add Fonts to Windows Docker container/image? | I have a console application that is built on .NET Framework v4.8. I am trying to run it in Azure Container Instances(ACI) using the docker image. I have created a docker image locally and pushed it to ACI and it is running successfully. Now I am facing one issue. This application sends an email with RDLC reports. But ... | How to add Fonts to Windows Docker container/image? I have a console application that is built on .NET Framework v4.8. I am trying to run it in Azure Container Instances(ACI) using the docker image. I have created a docker image locally and pushed it to ACI and it is running successfully. Now I am facing one issue. Thi... | docker, containers, azure-container-instances, windows-container, .net-4.8 | 6 | 9,380 | 2 | https://stackoverflow.com/questions/59779075/how-to-add-fonts-to-windows-docker-container-image |
59,161,114 | Print custom message from until loop in ansible | I am trying to run a command multiple times and check if the output contains some string in it("hi"). I am purposefully simulating failure and expecting the until loop to fail. Everything is good till this point. Now, I need to have some custom message stating why the until loop or the task failed. For Example: "Your c... | Print custom message from until loop in ansible I am trying to run a command multiple times and check if the output contains some string in it("hi"). I am purposefully simulating failure and expecting the until loop to fail. Everything is good till this point. Now, I need to have some custom message stating why the unt... | ansible | 6 | 5,203 | 2 | https://stackoverflow.com/questions/59161114/print-custom-message-from-until-loop-in-ansible |
58,972,338 | Can podman connect to a remote docker host by setting $DOCKER_HOST? | I know that podman is a daemonless container engine, which is a plus. But if I need to start a container on a remote host running docker server, is this possible through podman? e.g. Having placed the corresponding certificates into ~/.docker/ would the following run hello-world on the remote server, as docker command ... | Can podman connect to a remote docker host by setting $DOCKER_HOST? I know that podman is a daemonless container engine, which is a plus. But if I need to start a container on a remote host running docker server, is this possible through podman? e.g. Having placed the corresponding certificates into ~/.docker/ would th... | docker, podman | 6 | 4,650 | 3 | https://stackoverflow.com/questions/58972338/can-podman-connect-to-a-remote-docker-host-by-setting-docker-host |
58,917,757 | How to set no_log: true for molecule internal playbook tasks? | I am testing version compatibility with molecule and for the combination python 3.8 x ansible latest x debian molecule breaks in the instance creation step with TASK [Wait for instance(s) creation to complete] ******************************* FAILED - RETRYING: Wait for instance(s) creation to complete (300 retries left... | How to set no_log: true for molecule internal playbook tasks? I am testing version compatibility with molecule and for the combination python 3.8 x ansible latest x debian molecule breaks in the instance creation step with TASK [Wait for instance(s) creation to complete] ******************************* FAILED - RETRYIN... | docker, ansible, molecule | 6 | 7,834 | 1 | https://stackoverflow.com/questions/58917757/how-to-set-no-log-true-for-molecule-internal-playbook-tasks |
58,344,674 | Ansible copy does not retain original permissions with mode "preserve" when using remote_src | I'm using Ansible 2.8.5 (and the target servers are Red Hat 4.8.5-39 ). I'm copying some files/directories from GitLab into several remote hosts. I'm doing an initial copy first into a shared location (hence the run_once: true ): - name: "Copy/Transfer application, configuration, and support file(s)" block: - name: "Co... | Ansible copy does not retain original permissions with mode "preserve" when using remote_src I'm using Ansible 2.8.5 (and the target servers are Red Hat 4.8.5-39 ). I'm copying some files/directories from GitLab into several remote hosts. I'm doing an initial copy first into a shared location (hence the run_once: true ... | ansible, ansible-2.x | 6 | 13,410 | 4 | https://stackoverflow.com/questions/58344674/ansible-copy-does-not-retain-original-permissions-with-mode-preserve-when-usin |
57,790,017 | C++ STL Container requirements - Post condition confusion | I am currently looking at implementing a custom container which needs to be compatible with STL algorithms and therefore must meet the C++ container requirements as described here . In that documentation the Methods and operators table states, that the expression a = b has the post condition of a == b . I am heavily co... | C++ STL Container requirements - Post condition confusion I am currently looking at implementing a custom container which needs to be compatible with STL algorithms and therefore must meet the C++ container requirements as described here . In that documentation the Methods and operators table states, that the expressio... | c++, containers, language-lawyer | 6 | 222 | 1 | https://stackoverflow.com/questions/57790017/c-stl-container-requirements-post-condition-confusion |
56,323,549 | Loop over json objects in Ansible | I have been stuck to get a particular json object if the value of a key matches a variable (string). My json file looks like this: "totalRecordsWithoutPaging": 1234, "jobs": [ { "jobSummary": { "totalNumOfFiles": 0, "jobId": 8035, "destClientName": "BOSDEKARLSSP010", "destinationClient": { "clientId": 10, "clientName":... | Loop over json objects in Ansible I have been stuck to get a particular json object if the value of a key matches a variable (string). My json file looks like this: "totalRecordsWithoutPaging": 1234, "jobs": [ { "jobSummary": { "totalNumOfFiles": 0, "jobId": 8035, "destClientName": "BOSDEKARLSSP010", "destinationClient... | json, loops, ansible | 6 | 31,860 | 1 | https://stackoverflow.com/questions/56323549/loop-over-json-objects-in-ansible |
56,110,622 | How to use ansible to run a script which ask user input? | I want to run a shell script using ansible but the shell script requires user input to execute successfully, For example : my shell script asking the unique id for an ossec agent , through ansible I can able to predefined my unique id (user input ). | How to use ansible to run a script which ask user input? I want to run a shell script using ansible but the shell script requires user input to execute successfully, For example : my shell script asking the unique id for an ossec agent , through ansible I can able to predefined my unique id (user input ). | shell, ansible, user-input | 6 | 9,492 | 2 | https://stackoverflow.com/questions/56110622/how-to-use-ansible-to-run-a-script-which-ask-user-input |
56,025,638 | How to escape double-quotes in ansible variable | I have an ansible playbook which accepts a variable, passing a variable with quotes in it(its needed), that variable will used to query against DB Playbook - name: Execute clear script script: scripts/clear-documents.sh {{ids}} Command ansible-playbook playbooks/maintenance.yml -i hosts -t clear -e ids=["foo", "bar"] i... | How to escape double-quotes in ansible variable I have an ansible playbook which accepts a variable, passing a variable with quotes in it(its needed), that variable will used to query against DB Playbook - name: Execute clear script script: scripts/clear-documents.sh {{ids}} Command ansible-playbook playbooks/maintenan... | ansible | 6 | 47,477 | 2 | https://stackoverflow.com/questions/56025638/how-to-escape-double-quotes-in-ansible-variable |
55,844,981 | Ansible: Insert word in GRUB cmdline | I'd like to use Ansible's lineinfile or replace module in order to add the word splash to the cmdline in GRUB. It should work for all the following examples: Example 1: Before: GRUB_CMDLINE_DEFAULT="" After: GRUB_CMDLINE_DEFAULT="splash" Example 2: Before: GRUB_CMDLINE_DEFAULT="quiet" After: GRUB_CMDLINE_DEFAULT="quiet... | Ansible: Insert word in GRUB cmdline I'd like to use Ansible's lineinfile or replace module in order to add the word splash to the cmdline in GRUB. It should work for all the following examples: Example 1: Before: GRUB_CMDLINE_DEFAULT="" After: GRUB_CMDLINE_DEFAULT="splash" Example 2: Before: GRUB_CMDLINE_DEFAULT="quie... | regex, ansible | 6 | 17,173 | 8 | https://stackoverflow.com/questions/55844981/ansible-insert-word-in-grub-cmdline |
55,258,817 | Is there any way to exec into an initContainer in Kubernetes | I have a init container in which I'm storing file but while running it's showing the file is not present. Is there any way I can exec inside init container and check where the file is being stored. | Is there any way to exec into an initContainer in Kubernetes I have a init container in which I'm storing file but while running it's showing the file is not present. Is there any way I can exec inside init container and check where the file is being stored. | docker, kubernetes, containers | 6 | 4,909 | 1 | https://stackoverflow.com/questions/55258817/is-there-any-way-to-exec-into-an-initcontainer-in-kubernetes |
54,466,460 | Apply module_defaults attribute to a role | I have the following file structure: webserver.yml emailserver.yml roles/ common/ tasks/ main.yml emailserver.yml and webserver.yml look like: - hosts: all roles: - common And main.yml : - name: apt-get update apt: update_cache: yes force_apt_get: yes - name: apt-get upgrade apt: name: "*" state: latest force_apt_get: ... | Apply module_defaults attribute to a role I have the following file structure: webserver.yml emailserver.yml roles/ common/ tasks/ main.yml emailserver.yml and webserver.yml look like: - hosts: all roles: - common And main.yml : - name: apt-get update apt: update_cache: yes force_apt_get: yes - name: apt-get upgrade ap... | ansible | 6 | 1,839 | 2 | https://stackoverflow.com/questions/54466460/apply-module-defaults-attribute-to-a-role |
54,452,070 | Ansible parse stdout_lines to verify values of a particular item | I am using ansible to write some tests. I have to parse through the output of a command (stdout_lines) and verify the information corresponding to a particular name. The stdout_lines looks like the following. The output is obtained from a cli command executed in bash. "stdout_lines": [ "--------------------------------... | Ansible parse stdout_lines to verify values of a particular item I am using ansible to write some tests. I have to parse through the output of a command (stdout_lines) and verify the information corresponding to a particular name. The stdout_lines looks like the following. The output is obtained from a cli command exec... | ansible, ansible-2.x | 6 | 14,950 | 1 | https://stackoverflow.com/questions/54452070/ansible-parse-stdout-lines-to-verify-values-of-a-particular-item |
53,746,646 | Disable Ansible's Powershell Encoding | Ansible ships work to Windows endpoints by encoding the Powershell and shipping a blob to the remote machine(s). It is difficult to figure out what is happening from a security perspective when this work is executed. Semi-advanced security tooling sometimes blocks this activity between Ansible and the host it needs to ... | Disable Ansible's Powershell Encoding Ansible ships work to Windows endpoints by encoding the Powershell and shipping a blob to the remote machine(s). It is difficult to figure out what is happening from a security perspective when this work is executed. Semi-advanced security tooling sometimes blocks this activity bet... | windows, powershell, security, encoding, ansible | 6 | 1,845 | 1 | https://stackoverflow.com/questions/53746646/disable-ansibles-powershell-encoding |
50,445,356 | How to enumerate hosts in ansible? | I am new to using Ansible and using it to automate the configuration of master slave node clusters. I have a hosts file split into two groups: [master] masternode [slaves] slavenode0 slavenode1 What I would like to to is iterate through the slaves group such that a line in a file on the remote machine is updated with t... | How to enumerate hosts in ansible? I am new to using Ansible and using it to automate the configuration of master slave node clusters. I have a hosts file split into two groups: [master] masternode [slaves] slavenode0 slavenode1 What I would like to to is iterate through the slaves group such that a line in a file on t... | ansible, ansible-2.x | 6 | 12,005 | 2 | https://stackoverflow.com/questions/50445356/how-to-enumerate-hosts-in-ansible |
46,669,172 | How to fix permission denied error when trying to install packages using Ansible? | I'm trying to write a simple Ansible Playbook, please look at snippets below. Using Ansible 2.4.0.0, Ubuntu 17.04, Python 2.7.13. This is my first time using Ansible and Playbooks so please don't be too harsh. What am I doing wrong? playbook.yml --- - name: install packages hosts: dbservers become: yes become_method: s... | How to fix permission denied error when trying to install packages using Ansible? I'm trying to write a simple Ansible Playbook, please look at snippets below. Using Ansible 2.4.0.0, Ubuntu 17.04, Python 2.7.13. This is my first time using Ansible and Playbooks so please don't be too harsh. What am I doing wrong? playb... | ansible, ansible-inventory | 6 | 30,155 | 2 | https://stackoverflow.com/questions/46669172/how-to-fix-permission-denied-error-when-trying-to-install-packages-using-ansible |
45,449,852 | Ansible Recursive Directory Copy | Ansible version: 2.2.1.0 I'm having trouble copying the contents of a directory to a destination host in Ansible. My role directory structure looks like this: roles/server/ +-- defaults | +-- main.yml +-- files | +-- Common-x86_64.repo | +-- docker-ce-stable.repo | +-- handlers | +-- main.yml +-- meta | +-- main.yml +-... | Ansible Recursive Directory Copy Ansible version: 2.2.1.0 I'm having trouble copying the contents of a directory to a destination host in Ansible. My role directory structure looks like this: roles/server/ +-- defaults | +-- main.yml +-- files | +-- Common-x86_64.repo | +-- docker-ce-stable.repo | +-- handlers | +-- ma... | ansible | 6 | 19,321 | 3 | https://stackoverflow.com/questions/45449852/ansible-recursive-directory-copy |
44,525,784 | Having ansible run a script without the exit code stopping the ssh connection | We have an ansible task which looks like the following - name: Check if that created script: verification.sh register: verification changed_when: verification.rc == 1 The above task runs a script which returns an exit signal if failed or success. An example part would be if [[ "$item" == "$name" ]]; then printf "TEST" ... | Having ansible run a script without the exit code stopping the ssh connection We have an ansible task which looks like the following - name: Check if that created script: verification.sh register: verification changed_when: verification.rc == 1 The above task runs a script which returns an exit signal if failed or succ... | shell, ssh, ansible | 6 | 10,252 | 3 | https://stackoverflow.com/questions/44525784/having-ansible-run-a-script-without-the-exit-code-stopping-the-ssh-connection |
44,455,501 | How to get a docker container to the state: dead for debugging? | I need to get some containers to dead state, as I want to check if a script of mine is working. Any advice is welcome. Thank you. | How to get a docker container to the state: dead for debugging? I need to get some containers to dead state, as I want to check if a script of mine is working. Any advice is welcome. Thank you. | docker, containers, dockerfile | 6 | 4,802 | 2 | https://stackoverflow.com/questions/44455501/how-to-get-a-docker-container-to-the-state-dead-for-debugging |
44,045,091 | Ansible: run multiple action | I am running ansible to copy and execute the script on remote side if script not found. but I am getting this error. ERROR! conflicting action statements: copy, command How can i use multiple action in single task. --- - name: Check if the bb.sh exists stat: path: /tmp/bb.sh register: stat_result - name: Copy and execu... | Ansible: run multiple action I am running ansible to copy and execute the script on remote side if script not found. but I am getting this error. ERROR! conflicting action statements: copy, command How can i use multiple action in single task. --- - name: Check if the bb.sh exists stat: path: /tmp/bb.sh register: stat_... | ansible | 6 | 24,240 | 3 | https://stackoverflow.com/questions/44045091/ansible-run-multiple-action |
43,084,220 | Ansible template module not parsing with_items variable | I am using a simple template with only variables in it. This is how my task looks like in my playbook (actually a role being used from my playbook): - name: Ensure the conf file exists template: src: file.conf.j2 dest: '/opt/file.conf' with_items: '{{ myrole }}' I keep variables in group_vars. Any variable in file.conf... | Ansible template module not parsing with_items variable I am using a simple template with only variables in it. This is how my task looks like in my playbook (actually a role being used from my playbook): - name: Ensure the conf file exists template: src: file.conf.j2 dest: '/opt/file.conf' with_items: '{{ myrole }}' I... | ansible, jinja2, ansible-template | 6 | 13,260 | 1 | https://stackoverflow.com/questions/43084220/ansible-template-module-not-parsing-with-items-variable |
42,140,942 | ansible conditional templates | I want to have a simple if else condition in ansibles jinja templates. For plain python cluster_name+'A' if isCondition is True else cluster_name +'B' wors great if the following variables are defined: isSingleNode = True cluster_name = 'example' In ansible I see the following error: fatal: [localhost]: FAILED! => {"ch... | ansible conditional templates I want to have a simple if else condition in ansibles jinja templates. For plain python cluster_name+'A' if isCondition is True else cluster_name +'B' wors great if the following variables are defined: isSingleNode = True cluster_name = 'example' In ansible I see the following error: fatal... | python, ansible, jinja2, ansible-2.x, ansible-template | 6 | 20,766 | 1 | https://stackoverflow.com/questions/42140942/ansible-conditional-templates |
42,022,903 | Run Python script with arguments in Ansible | I want to run a Python script from inside of an ansible playbook, with input arguments. How do I do it? I tried command , but it doesn't seem to take any input arguments. I also tried script , but it seems to be considering only bash scripts. PS: I am taking in the input arguments as --extra-vars . | Run Python script with arguments in Ansible I want to run a Python script from inside of an ansible playbook, with input arguments. How do I do it? I tried command , but it doesn't seem to take any input arguments. I also tried script , but it seems to be considering only bash scripts. PS: I am taking in the input argu... | python, ansible | 6 | 31,040 | 3 | https://stackoverflow.com/questions/42022903/run-python-script-with-arguments-in-ansible |
41,571,716 | Ansible first hostname of groups | I am not sure on how to find the first ansible hostname from group_names. Could you kindly advise me on how to do it? hosts [webservers] server1 server2 server3 [webserver-el7] server4 server5 server6 And i have 2 different playbook for each host groups playbook1.yml - name: deploy app hosts: webservers serial: 8 roles... | Ansible first hostname of groups I am not sure on how to find the first ansible hostname from group_names. Could you kindly advise me on how to do it? hosts [webservers] server1 server2 server3 [webserver-el7] server4 server5 server6 And i have 2 different playbook for each host groups playbook1.yml - name: deploy app ... | ansible, ansible-2.x | 6 | 16,607 | 2 | https://stackoverflow.com/questions/41571716/ansible-first-hostname-of-groups |
40,206,776 | Ansible: Variables defined under defaults are not loaded in to my playbook | I have defined a role dcn-rq2 and it has some variables defined in ~/dcn-rq2/defaults/main.yml file and i have written a playbook which includes this role at the top as shown below. my understanding is that all the vraiables defined in the role should automatically available to the playbook but it errors out. //My top ... | Ansible: Variables defined under defaults are not loaded in to my playbook I have defined a role dcn-rq2 and it has some variables defined in ~/dcn-rq2/defaults/main.yml file and i have written a playbook which includes this role at the top as shown below. my understanding is that all the vraiables defined in the role ... | variables, ansible, role | 6 | 4,954 | 2 | https://stackoverflow.com/questions/40206776/ansible-variables-defined-under-defaults-are-not-loaded-in-to-my-playbook |
39,673,842 | Is possible to define ansible_tmp variable in playbook? | I want to copy large files using ansible. Destination servers have a dedicated partition with adequate storage space. I noticed that ansible uses its temporary directory which defined by remote_tmp variable. I would to copy directly files in the dedicated partition without passing by temporary directory. Is it possible... | Is possible to define ansible_tmp variable in playbook? I want to copy large files using ansible. Destination servers have a dedicated partition with adequate storage space. I noticed that ansible uses its temporary directory which defined by remote_tmp variable. I would to copy directly files in the dedicated partitio... | ansible | 6 | 20,323 | 3 | https://stackoverflow.com/questions/39673842/is-possible-to-define-ansible-tmp-variable-in-playbook |
39,005,248 | Ansible multiple includes "in block" | I have a playbook with includes: - include: include1.yml when: doinclude | default('true') - include: include2.yml when: doinclude | default('true') Is there any possibility not to repeat the condition? I tried blocks but it seems blocks cannot be used in that context: - block: - include: include1.yml - include: includ... | Ansible multiple includes "in block" I have a playbook with includes: - include: include1.yml when: doinclude | default('true') - include: include2.yml when: doinclude | default('true') Is there any possibility not to repeat the condition? I tried blocks but it seems blocks cannot be used in that context: - block: - in... | ansible, ansible-2.x | 6 | 12,464 | 2 | https://stackoverflow.com/questions/39005248/ansible-multiple-includes-in-block |
38,868,195 | Create GCE instance using Ansible, permissions issues | I'm following the documentation for creating an instance using Ansible [URL] However, when I run this I get: Required 'compute.zones.list' permission for 'projects/quick-line-137923' I don't know where I'm meant to configure these permissions for a service account, because the documentation seems to suggest that you ca... | Create GCE instance using Ansible, permissions issues I'm following the documentation for creating an instance using Ansible [URL] However, when I run this I get: Required 'compute.zones.list' permission for 'projects/quick-line-137923' I don't know where I'm meant to configure these permissions for a service account, ... | permissions, ansible, google-cloud-platform | 6 | 1,369 | 1 | https://stackoverflow.com/questions/38868195/create-gce-instance-using-ansible-permissions-issues |
37,268,358 | Ansible ufw module ERROR: Could not find a profile matching 'xxxxx' | I'm working to setup UFW rules via Ansible. I'm able to get it installed, start it and deny everything. I then attempt to allow connections from http, https, and ssh. All attempts to add the allow for those items are met with errors that look like: failed: [lempy1] (item={u'service': u'http'}) => {"failed": true, "item... | Ansible ufw module ERROR: Could not find a profile matching 'xxxxx' I'm working to setup UFW rules via Ansible. I'm able to get it installed, start it and deny everything. I then attempt to allow connections from http, https, and ssh. All attempts to add the allow for those items are met with errors that look like: fai... | ansible, ufw | 6 | 9,929 | 1 | https://stackoverflow.com/questions/37268358/ansible-ufw-module-error-could-not-find-a-profile-matching-xxxxx |
37,137,513 | ansible install node.js version 6 | For installing the node 6.x version these are the commands: curl -sL [URL] | sudo -E bash - sudo apt-get install -y nodejs now how exactly do I do that in ansible? any ideas here? this is what I had till now, but it installs the old version --- - name: Ensure Ubuntu Distro is Supported get_url: url='[URL] ansible_distr... | ansible install node.js version 6 For installing the node 6.x version these are the commands: curl -sL [URL] | sudo -E bash - sudo apt-get install -y nodejs now how exactly do I do that in ansible? any ideas here? this is what I had till now, but it installs the old version --- - name: Ensure Ubuntu Distro is Supported... | node.js, ansible | 6 | 6,969 | 2 | https://stackoverflow.com/questions/37137513/ansible-install-node-js-version-6 |
35,880,539 | What files do you typically put in .dockerignore | I am building a Django application with docker. I would like to know for Django or general development work using docker, what files are typically included in the .dockerignore. I am thinking of the following for now: .git *.pyc | What files do you typically put in .dockerignore I am building a Django application with docker. I would like to know for Django or general development work using docker, what files are typically included in the .dockerignore. I am thinking of the following for now: .git *.pyc | docker, containers | 6 | 8,807 | 2 | https://stackoverflow.com/questions/35880539/what-files-do-you-typically-put-in-dockerignore |
35,746,497 | Deleting an element of a container by directly accessing its iterator alone in C++ | I have declared a std::vector<int> in my main function and would like to remove all even elements from it, but only by passing it's iterator to a function called remove_even which accepts the start and end iterator of the container. #include <iostream> #include <algorithm> #include <vector> void remove_even(auto start,... | Deleting an element of a container by directly accessing its iterator alone in C++ I have declared a std::vector<int> in my main function and would like to remove all even elements from it, but only by passing it's iterator to a function called remove_even which accepts the start and end iterator of the container. #inc... | c++, vector, iterator, containers | 6 | 246 | 5 | https://stackoverflow.com/questions/35746497/deleting-an-element-of-a-container-by-directly-accessing-its-iterator-alone-in-c |
35,603,049 | Why ansible become_user does nothing unless become=yes? | Why ansible become_user does nothing unless become=yes? I am am wondering if someone can explain me why using the option become_user: xxx silently fails to do anything unless you also add become: yes What's the point of having two different options, and especially to fail to su and not to say a thing about it. | Why ansible become_user does nothing unless become=yes? Why ansible become_user does nothing unless become=yes? I am am wondering if someone can explain me why using the option become_user: xxx silently fails to do anything unless you also add become: yes What's the point of having two different options, and especially... | ansible | 6 | 4,541 | 1 | https://stackoverflow.com/questions/35603049/why-ansible-become-user-does-nothing-unless-become-yes |
35,489,380 | Using a variable from one Ansible var file in a second var file | In using Ansible, I'm trying to use a vaulted vars file to store private variables, and then using those in another vars file, in the same role. (The idea from 'Vault Pseudo leaf encryption' here .) e.g. I have one standard vars file, roles/myrole/vars/main.yml : --- my_variable: '{{ my_variable_vaulted }}' and then on... | Using a variable from one Ansible var file in a second var file In using Ansible, I'm trying to use a vaulted vars file to store private variables, and then using those in another vars file, in the same role. (The idea from 'Vault Pseudo leaf encryption' here .) e.g. I have one standard vars file, roles/myrole/vars/mai... | ansible, ansible-vault | 6 | 3,725 | 2 | https://stackoverflow.com/questions/35489380/using-a-variable-from-one-ansible-var-file-in-a-second-var-file |
33,522,226 | Why is Ansible not Running Pip as sudo user? | I have a playbook that ensures all requirements are installed locally. I am using ansible 2.0.0 ansible-playbook site.yml -i staging site.yml: --- - hosts: localhost become: yes become_user: "{{ sudo_user }}" connection: local vars_files: - vars/main.yml roles: - do sudo_user is surfer190 in vars. do/tasks/main.yml: - ... | Why is Ansible not Running Pip as sudo user? I have a playbook that ensures all requirements are installed locally. I am using ansible 2.0.0 ansible-playbook site.yml -i staging site.yml: --- - hosts: localhost become: yes become_user: "{{ sudo_user }}" connection: local vars_files: - vars/main.yml roles: - do sudo_use... | pip, ansible | 6 | 7,059 | 2 | https://stackoverflow.com/questions/33522226/why-is-ansible-not-running-pip-as-sudo-user |
33,184,774 | Running ipython notebook in a Docker Container | Can someone share the steps to run iPython notebook in a container. I tried to run ipython notebook command in my ubuntu 14.04 container shell. The only problem is that it can not find a web browser to open on, since containers only work for service applications instead of interactive ones. Any suggestions? | Running ipython notebook in a Docker Container Can someone share the steps to run iPython notebook in a container. I tried to run ipython notebook command in my ubuntu 14.04 container shell. The only problem is that it can not find a web browser to open on, since containers only work for service applications instead of... | docker, containers, jupyter-notebook | 6 | 8,418 | 4 | https://stackoverflow.com/questions/33184774/running-ipython-notebook-in-a-docker-container |
33,162,552 | how to extend windows path variable using ansible | Using win_environment, it is possible to add/remove environment variables to a windows host. But to modify variables that are already there, win_environment does not seem to be useful as u can't read old value to modify and update a variable. right? | how to extend windows path variable using ansible Using win_environment, it is possible to add/remove environment variables to a windows host. But to modify variables that are already there, win_environment does not seem to be useful as u can't read old value to modify and update a variable. right? | windows, path, ansible | 6 | 11,414 | 6 | https://stackoverflow.com/questions/33162552/how-to-extend-windows-path-variable-using-ansible |
32,776,217 | Run a batch file in windows using ansible | I want to run a run.bat file present on my remote windows node using my control node (CentOS) . Is it possible? If not is there any alternative to do so? | Run a batch file in windows using ansible I want to run a run.bat file present on my remote windows node using my control node (CentOS) . Is it possible? If not is there any alternative to do so? | windows, batch-file, ansible | 6 | 24,801 | 4 | https://stackoverflow.com/questions/32776217/run-a-batch-file-in-windows-using-ansible |
32,557,704 | Ansible to loop x times | I have to do some benchmarks and loop over 10 commands 3 times (run all 10x3, not the firstx3 then the secondx3 - so run all 10x3). The 10 commands I extract from a file in a register variable (it doesn't work with_lines: and then the command) and execute them 1,2,3..,10 pipe the output in a file, echo something and th... | Ansible to loop x times I have to do some benchmarks and loop over 10 commands 3 times (run all 10x3, not the firstx3 then the secondx3 - so run all 10x3). The 10 commands I extract from a file in a register variable (it doesn't work with_lines: and then the command) and execute them 1,2,3..,10 pipe the output in a fil... | loops, ansible, roles | 6 | 8,522 | 3 | https://stackoverflow.com/questions/32557704/ansible-to-loop-x-times |
31,997,812 | ansible how to add existing host to a group | I want to dynamically add an existing host to multiple groups based on a variable defined on the host. Is there a way to do it. I can do group_by, but that only puts it in one group. eg in my hosts file i have [dc1hosts] 1.1.1.1 1.1.1.2 [dc1hosts:vars] iamDB=True iamCache=True <more-properties> [dc2hosts] 2.1.1.1 2.2.2... | ansible how to add existing host to a group I want to dynamically add an existing host to multiple groups based on a variable defined on the host. Is there a way to do it. I can do group_by, but that only puts it in one group. eg in my hosts file i have [dc1hosts] 1.1.1.1 1.1.1.2 [dc1hosts:vars] iamDB=True iamCache=Tru... | ansible | 6 | 9,009 | 1 | https://stackoverflow.com/questions/31997812/ansible-how-to-add-existing-host-to-a-group |
31,924,360 | Unable to locate package while building Docker image | During my Docker container build process, I attemptted to install a few packages using apt-get install. However the process failed to complete because the 3 of the 4 packages could not be found. Step 1 : RUN apt-get update && apt-get install -y netcat ca-certificates build-essential libssl-dev ---> Running in 38d22d97e... | Unable to locate package while building Docker image During my Docker container build process, I attemptted to install a few packages using apt-get install. However the process failed to complete because the 3 of the 4 packages could not be found. Step 1 : RUN apt-get update && apt-get install -y netcat ca-certificates... | ubuntu, docker, containers, apt-get | 6 | 11,257 | 2 | https://stackoverflow.com/questions/31924360/unable-to-locate-package-while-building-docker-image |
31,883,507 | Ansible get_url fails to download a protected by basic auth | I'm trying to download a protected file using HTTP from a remote server with the get_url module but the username password does not seem to get passed in the request and the task therefore fails. I'm using Ansible 1.9.2 Here is the get_url definition I'm using: - name: Downloading Artifact get_url: url: "[URL] dest: "/h... | Ansible get_url fails to download a protected by basic auth I'm trying to download a protected file using HTTP from a remote server with the get_url module but the username password does not seem to get passed in the request and the task therefore fails. I'm using Ansible 1.9.2 Here is the get_url definition I'm using:... | ansible | 6 | 14,357 | 3 | https://stackoverflow.com/questions/31883507/ansible-get-url-fails-to-download-a-protected-by-basic-auth |
31,815,763 | Wildcard in Ansible inventory group | I have hosts groups defined in the single inventory file. Groups are split into datacenters. [first.dc1] ... [second.dc1] ... [first.dc2] ... [second.dc2] ... I want to define child grouping all groups with suffix dc1 [dc1:children] *.dc1 Is it possible in Ansible? I've tried *, all, ranges but it doesn't work | Wildcard in Ansible inventory group I have hosts groups defined in the single inventory file. Groups are split into datacenters. [first.dc1] ... [second.dc1] ... [first.dc2] ... [second.dc2] ... I want to define child grouping all groups with suffix dc1 [dc1:children] *.dc1 Is it possible in Ansible? I've tried *, all,... | ansible | 6 | 9,202 | 1 | https://stackoverflow.com/questions/31815763/wildcard-in-ansible-inventory-group |
30,735,896 | c++ container very efficient at adding elements to the end | I have been running a c++ program for scientific purpose and I am now looking at optimizing it. The bottleneck seems to be a function where I need to stack pairs of integers. Their number is impossible to know from the start, and I have been using a std::vector of a custom struct holding two ints . Is there a more effi... | c++ container very efficient at adding elements to the end I have been running a c++ program for scientific purpose and I am now looking at optimizing it. The bottleneck seems to be a function where I need to stack pairs of integers. Their number is impossible to know from the start, and I have been using a std::vector... | c++, vector, containers | 6 | 1,669 | 2 | https://stackoverflow.com/questions/30735896/c-container-very-efficient-at-adding-elements-to-the-end |
30,372,198 | What is the best approach for wrapping an STL container in a custom iterator? | To illustrate, say I have a custom container than makes use of the STL std::vector internally. If I typedef std::vector<char*>::iterator to my_container::iterator , then dereferencing the iterator will return a char* . However, my custom container should hide its internals, meaning I want a dereferencing to return a ch... | What is the best approach for wrapping an STL container in a custom iterator? To illustrate, say I have a custom container than makes use of the STL std::vector internally. If I typedef std::vector<char*>::iterator to my_container::iterator , then dereferencing the iterator will return a char* . However, my custom cont... | c++, iterator, containers, template-meta-programming | 6 | 1,619 | 3 | https://stackoverflow.com/questions/30372198/what-is-the-best-approach-for-wrapping-an-stl-container-in-a-custom-iterator |
29,668,129 | Permission denied when trying to install inside a virtualenv using ansible | I have this play in my ansible playbook - name: Setup virtualenv pip: requirements="/vagrant/webapp/requirements/{{ requirements_filename }}" virtualenv="$HOME/.envs/{{ project_name }}" However, I am receiving a Permission denied error. It seems like ansible is trying to install the package into the system path and not... | Permission denied when trying to install inside a virtualenv using ansible I have this play in my ansible playbook - name: Setup virtualenv pip: requirements="/vagrant/webapp/requirements/{{ requirements_filename }}" virtualenv="$HOME/.envs/{{ project_name }}" However, I am receiving a Permission denied error. It seems... | ansible | 6 | 6,208 | 4 | https://stackoverflow.com/questions/29668129/permission-denied-when-trying-to-install-inside-a-virtualenv-using-ansible |
29,070,304 | Ansible variable assignment | I want to run a role 10 times in a playbook and only on the 5th run of that role, I want it to run the second shell cmd from within that role. How can I address that? Playbook: - name: bla bla hosts: ALL remote_user: root vars: some_variable: 0 roles: - role: nonreg whentorun: - post The actual role is this: - name: ba... | Ansible variable assignment I want to run a role 10 times in a playbook and only on the 5th run of that role, I want it to run the second shell cmd from within that role. How can I address that? Playbook: - name: bla bla hosts: ALL remote_user: root vars: some_variable: 0 roles: - role: nonreg whentorun: - post The act... | variables, ansible, increment, roles | 6 | 11,776 | 1 | https://stackoverflow.com/questions/29070304/ansible-variable-assignment |
27,371,966 | Running Forever in Ansible Provision Never Fires or Always Hangs | I've come across a problem with Anisble hanging when trying to start a forever process on an Ansible node. I have a very simple API server I'm creating in vagrant and provisioning with Ansible like so: --- - hosts: all sudo: yes roles: - Stouts.nodejs - Stouts.mongodb tasks: - name: Install Make Dependencies apt: name=... | Running Forever in Ansible Provision Never Fires or Always Hangs I've come across a problem with Anisble hanging when trying to start a forever process on an Ansible node. I have a very simple API server I'm creating in vagrant and provisioning with Ansible like so: --- - hosts: all sudo: yes roles: - Stouts.nodejs - S... | node.js, ansible, forever | 6 | 1,236 | 1 | https://stackoverflow.com/questions/27371966/running-forever-in-ansible-provision-never-fires-or-always-hangs |
27,277,675 | postgres in vagrant(ubuntu14.04) | I tried to create simple dev environment with vagrant but fall in problem with postgres. My Vagrantfile is simple: # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config... | postgres in vagrant(ubuntu14.04) I tried to create simple dev environment with vagrant but fall in problem with postgres. My Vagrantfile is simple: # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VA... | postgresql, vagrant, ubuntu-14.04, ansible | 6 | 1,688 | 2 | https://stackoverflow.com/questions/27277675/postgres-in-vagrantubuntu14-04 |
26,460,067 | Can I use sudo in Ansible with connection "local"? | I give up, just can't understand how to use Ansible with "connection: local" + "sudo: yes". I have something like: ansible-playbook ansible/desktop.yml - hosts: localhost connection: local ... tasks: - apt_repository: repo='ppa:alexey-smirnov/deadbeef' sudo: yes I've also tried sudo_user: ... param, sudo before the com... | Can I use sudo in Ansible with connection "local"? I give up, just can't understand how to use Ansible with "connection: local" + "sudo: yes". I have something like: ansible-playbook ansible/desktop.yml - hosts: localhost connection: local ... tasks: - apt_repository: repo='ppa:alexey-smirnov/deadbeef' sudo: yes I've a... | ansible | 6 | 5,682 | 2 | https://stackoverflow.com/questions/26460067/can-i-use-sudo-in-ansible-with-connection-local |
26,125,569 | Use facts gathered by ansible programmatically | I'd like to write a Python program that uses the facts that Ansible gives me with ansible HOST -m setup . When I call this, I get a response which makes it only almost pure JSON: $ ansible localhost -m setup localhost | success >> { // actual data } Is there some way to get this JSON response directly without parsing t... | Use facts gathered by ansible programmatically I'd like to write a Python program that uses the facts that Ansible gives me with ansible HOST -m setup . When I call this, I get a response which makes it only almost pure JSON: $ ansible localhost -m setup localhost | success >> { // actual data } Is there some way to ge... | python, ansible, ansible-facts | 6 | 7,428 | 2 | https://stackoverflow.com/questions/26125569/use-facts-gathered-by-ansible-programmatically |
25,458,343 | simple ansible command meets "ERROR: The file hosts is marked as executable" | new to ansible. I installed ansible in ubuntu vm 14.04.1 version using ppa installation user@ubuntu:~$ ansible --version ansible 1.7 And created the hosts file with localhost only user@ubuntu:~$ cat hosts localhost When I try to run this simple command user@ubuntu:~$ ansible -i hosts all -m ping --ask-pass SSH password... | simple ansible command meets "ERROR: The file hosts is marked as executable" new to ansible. I installed ansible in ubuntu vm 14.04.1 version using ppa installation user@ubuntu:~$ ansible --version ansible 1.7 And created the hosts file with localhost only user@ubuntu:~$ cat hosts localhost When I try to run this simpl... | ansible | 6 | 2,731 | 2 | https://stackoverflow.com/questions/25458343/simple-ansible-command-meets-error-the-file-hosts-is-marked-as-executable |
24,743,085 | Ansible SSH as one user and Sudo as another | I have some difficulties to adapt Ansible configuration to my environment. My testing environment : PermitRootLogin no Only one user allowed to connect through SSH (foo, without any privileges) A user with sudo privileges (bar ALL=(ALL) ALL) My ansible host inventory looks like this : [servers] server1 ansible_ssh_host... | Ansible SSH as one user and Sudo as another I have some difficulties to adapt Ansible configuration to my environment. My testing environment : PermitRootLogin no Only one user allowed to connect through SSH (foo, without any privileges) A user with sudo privileges (bar ALL=(ALL) ALL) My ansible host inventory looks li... | ssh, ansible, sudo, ansible-inventory, ansible-ad-hoc | 6 | 5,241 | 1 | https://stackoverflow.com/questions/24743085/ansible-ssh-as-one-user-and-sudo-as-another |
22,760,638 | How to register an agent from different platform to a different platform located remotely in JADE? | I have two pc's on which i am running agents.Both are connected by LAN(or wifi). I want these agents to communicate. One of the ways i found is by giving agent's full addresses.Below is the code snippet. AID a = new AID("A@192.168.14.51:1099/JADE",AID.ISGUID); a.addAddresses("[URL] msg.addReceiver(a); send(msg); howeve... | How to register an agent from different platform to a different platform located remotely in JADE? I have two pc's on which i am running agents.Both are connected by LAN(or wifi). I want these agents to communicate. One of the ways i found is by giving agent's full addresses.Below is the code snippet. AID a = new AID("... | java, containers, agent, agents-jade | 6 | 2,971 | 1 | https://stackoverflow.com/questions/22760638/how-to-register-an-agent-from-different-platform-to-a-different-platform-located |
22,753,081 | bootstrapping ansible prerequisites with the script module. python required? | Goal: Given a Debian server without python installed (and a few other missing ansible prerequisites), use ansible to get them installed so I can then use the normal ansible modules (almost all of which require python) to provision the server. According to the ansible documentation for the "script" module , "This module... | bootstrapping ansible prerequisites with the script module. python required? Goal: Given a Debian server without python installed (and a few other missing ansible prerequisites), use ansible to get them installed so I can then use the normal ansible modules (almost all of which require python) to provision the server. ... | ansible | 6 | 4,697 | 2 | https://stackoverflow.com/questions/22753081/bootstrapping-ansible-prerequisites-with-the-script-module-python-required |
22,673,370 | Advantages and disadvantages of using a concatenated key rather than nested Map Container in C++ | I have been given a project to investigate alternatives to the current container that is used to store Data in order to make it more efficient. The current design involved 4 nested maps like that map< string, map< string, map< int, map< string, string> > > > Lets Name each data field as Company , Department , ID_of_emp... | Advantages and disadvantages of using a concatenated key rather than nested Map Container in C++ I have been given a project to investigate alternatives to the current container that is used to store Data in order to make it more efficient. The current design involved 4 nested maps like that map< string, map< string, m... | c++, stl, containers | 6 | 3,263 | 2 | https://stackoverflow.com/questions/22673370/advantages-and-disadvantages-of-using-a-concatenated-key-rather-than-nested-map |
22,183,495 | Heterogenous container using only static polymorphism | My goal is to implement a container (here a set of stacks, one for each type) that accepts many different types of objects simultaneously. This would be trivial to do at runtime, using void pointers (or a common base class for all stored types) and runtime type indentification (RTTI). Since all types the container is g... | Heterogenous container using only static polymorphism My goal is to implement a container (here a set of stacks, one for each type) that accepts many different types of objects simultaneously. This would be trivial to do at runtime, using void pointers (or a common base class for all stored types) and runtime type inde... | c++, templates, c++11, metaprogramming, containers | 6 | 2,737 | 4 | https://stackoverflow.com/questions/22183495/heterogenous-container-using-only-static-polymorphism |
22,027,902 | Keep Ansible DRY: How to avoid repeating variables? | Recently just started using Ansible and I have run into a problem. In one of my YAML structures I have defined something like this: --- # file: main.yml # # Jenkins variables for installation and configuration jenkins: debian: # Debian repository containing Jenkins and the associated key for accessing the repository re... | Keep Ansible DRY: How to avoid repeating variables? Recently just started using Ansible and I have run into a problem. In one of my YAML structures I have defined something like this: --- # file: main.yml # # Jenkins variables for installation and configuration jenkins: debian: # Debian repository containing Jenkins an... | ansible | 6 | 3,094 | 2 | https://stackoverflow.com/questions/22027902/keep-ansible-dry-how-to-avoid-repeating-variables |
21,972,438 | Getting rsync in Ansible to work with Vagrant | I want to test an Ansible script using Vagrant . Everything works fine until it tries to do a rsync to the remote host: - name: Install custom dev user settings local_action: command rsync -ave ssh roles/common/files/home/{{ item.name }} {{ ansible_ssh_user }}@{{ inventory_hostname }}:/#home/ with_items: dev_users when... | Getting rsync in Ansible to work with Vagrant I want to test an Ansible script using Vagrant . Everything works fine until it tries to do a rsync to the remote host: - name: Install custom dev user settings local_action: command rsync -ave ssh roles/common/files/home/{{ item.name }} {{ ansible_ssh_user }}@{{ inventory_... | vagrant, rsync, ansible | 6 | 4,016 | 4 | https://stackoverflow.com/questions/21972438/getting-rsync-in-ansible-to-work-with-vagrant |
21,966,246 | packer + ansible, how to specify the inventory file | When I use vagrant, I can specify the inventory file in the Vagrantfile. Example: config.vm.provision "ansible" do |ansible| ansible.playbook = "my_folder/playbook.yml" ansible.inventory_path = "my_folder/inventory_file" end How can I configure the inventory_file when I use packer? I can't see any related info in the o... | packer + ansible, how to specify the inventory file When I use vagrant, I can specify the inventory file in the Vagrantfile. Example: config.vm.provision "ansible" do |ansible| ansible.playbook = "my_folder/playbook.yml" ansible.inventory_path = "my_folder/inventory_file" end How can I configure the inventory_file when... | vagrant, ansible, digital-ocean, packer | 6 | 8,682 | 2 | https://stackoverflow.com/questions/21966246/packer-ansible-how-to-specify-the-inventory-file |
21,943,387 | create container from another container, applying each element some function in c++ | My question is simple, see example: std::array<int,6> a = {{0,1,2,3,4,5}}; // -- given container. auto F = []( int i ) { return i*i; }; // -- given function. std::vector<int> v; // need create // my solution: v.reserve( a.size () ); for( std::size_t i = 0; i < a.size(); ++i ) v.push_back( F(a[i]) ); // but I need somet... | create container from another container, applying each element some function in c++ My question is simple, see example: std::array<int,6> a = {{0,1,2,3,4,5}}; // -- given container. auto F = []( int i ) { return i*i; }; // -- given function. std::vector<int> v; // need create // my solution: v.reserve( a.size () ); for... | c++, c++11, iterator, containers, stl-algorithm | 6 | 1,144 | 3 | https://stackoverflow.com/questions/21943387/create-container-from-another-container-applying-each-element-some-function-in |
20,638,802 | Should I pass doctrine Registry or specific repositories, entity managers to DI container in symfony2? | what is the best practice for injecting repositories, entity managers to a service? I figured I can do it in at least three ways. 1. Injecting repositories, managers through the constructor This way the service can be covered with tests quite easily. All you need is to pass mocked dependencies to the constructor and yo... | Should I pass doctrine Registry or specific repositories, entity managers to DI container in symfony2? what is the best practice for injecting repositories, entity managers to a service? I figured I can do it in at least three ways. 1. Injecting repositories, managers through the constructor This way the service can be... | symfony, doctrine-orm, registry, containers, code-injection | 6 | 5,948 | 2 | https://stackoverflow.com/questions/20638802/should-i-pass-doctrine-registry-or-specific-repositories-entity-managers-to-di |
20,283,294 | Is a graceful reload idempotent for ansible? | We're now investigating Ansible to provision our servers. It's quite a default nginx, php-fpm & mysql setup. However, I am wondering about installation of these packages and how to make the playbook idempotent with the services running. For nginx, we've a default nginx.conf and some files in conf.d/ . For php, we've a ... | Is a graceful reload idempotent for ansible? We're now investigating Ansible to provision our servers. It's quite a default nginx, php-fpm & mysql setup. However, I am wondering about installation of these packages and how to make the playbook idempotent with the services running. For nginx, we've a default nginx.conf ... | php, mysql, nginx, provisioning, ansible | 6 | 5,189 | 2 | https://stackoverflow.com/questions/20283294/is-a-graceful-reload-idempotent-for-ansible |
13,979,654 | How to choose the container 960px wide and not to 1200px in Bootstrap | How to choose the container 960px wide and not to 1200px in Bootstrap? | How to choose the container 960px wide and not to 1200px in Bootstrap How to choose the container 960px wide and not to 1200px in Bootstrap? | twitter-bootstrap, containers, 960.gs | 6 | 18,485 | 5 | https://stackoverflow.com/questions/13979654/how-to-choose-the-container-960px-wide-and-not-to-1200px-in-bootstrap |
13,899,866 | How can I set up a global container (C++03)? | I want to define a global container (C++03), and here's an example code I tried, which does not work. #include <vector> #include <string> using namespace std; vector<string> Aries; Aries.push_back("Taurus"); // Line 6 int main() {} Compile error: prog.cpp:6:1: error: 'Aries' does not name a type It seems I can define a... | How can I set up a global container (C++03)? I want to define a global container (C++03), and here's an example code I tried, which does not work. #include <vector> #include <string> using namespace std; vector<string> Aries; Aries.push_back("Taurus"); // Line 6 int main() {} Compile error: prog.cpp:6:1: error: 'Aries'... | c++, global-variables, containers, c++03 | 6 | 3,375 | 4 | https://stackoverflow.com/questions/13899866/how-can-i-set-up-a-global-container-c03 |
12,987,296 | Is std::list order guaranteed? | Is the order of the elements within an std::list guaranteed to remain in-order (unless, of course, a sort or something occurs)? Moreover, is there any potentially undefined behavior with lists that might jumble them up? I was/am under the impression that containers such as std::deque and the like are order-safe, but al... | Is std::list order guaranteed? Is the order of the elements within an std::list guaranteed to remain in-order (unless, of course, a sort or something occurs)? Moreover, is there any potentially undefined behavior with lists that might jumble them up? I was/am under the impression that containers such as std::deque and ... | c++, stl, containers | 6 | 7,319 | 1 | https://stackoverflow.com/questions/12987296/is-stdlist-order-guaranteed |
12,260,955 | Proper use of new "container view" in XCode 4.5? | I recently discovered the new "container view" in XCode 4.5 Developer Preview and wondered whether this is the proper way to use it: | Proper use of new "container view" in XCode 4.5? I recently discovered the new "container view" in XCode 4.5 Developer Preview and wondered whether this is the proper way to use it: | view, containers, preview, xcode4.5 | 6 | 1,042 | 1 | https://stackoverflow.com/questions/12260955/proper-use-of-new-container-view-in-xcode-4-5 |
10,137,426 | Rotation of UIPageViewController in Container View Controller | I have a UIViewController that contains other ViewControllers. Initial ViewController is set in viewDidLoad: FirstViewController *first = [FirstViewController alloc] init]; first.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; first.view.frame = m_content.frame; [self addChil... | Rotation of UIPageViewController in Container View Controller I have a UIViewController that contains other ViewControllers. Initial ViewController is set in viewDidLoad: FirstViewController *first = [FirstViewController alloc] init]; first.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFle... | containers, uipageviewcontroller, screen-rotation | 6 | 3,957 | 2 | https://stackoverflow.com/questions/10137426/rotation-of-uipageviewcontroller-in-container-view-controller |
9,552,858 | Difference between Collection and Container | I am little confused about the difference between containers and collections. I read about them on Wikipedia and this is what I have understood.. Collections : Stores variable number of objects. Ex. list, set... Containers : DataStructures? Ex. dequeue, stack.. But I thought collections like list, tree etc are data str... | Difference between Collection and Container I am little confused about the difference between containers and collections. I read about them on Wikipedia and this is what I have understood.. Collections : Stores variable number of objects. Ex. list, set... Containers : DataStructures? Ex. dequeue, stack.. But I thought ... | java, c++, collections, containers | 6 | 10,293 | 4 | https://stackoverflow.com/questions/9552858/difference-between-collection-and-container |
6,885,436 | What is the difference between SGI slist and C++11 forward_list? | Both SGI slist and C++11 std::forward_list appear identical to me unless I have missed something; both implement a singly-linked list. I assume there is a difference though as the C++ Standard Commitee didn't adopt the name slist and instead chose a new name, forward_list, when they added the container into the Standar... | What is the difference between SGI slist and C++11 forward_list? Both SGI slist and C++11 std::forward_list appear identical to me unless I have missed something; both implement a singly-linked list. I assume there is a difference though as the C++ Standard Commitee didn't adopt the name slist and instead chose a new n... | list, c++11, containers, singly-linked-list | 6 | 3,851 | 3 | https://stackoverflow.com/questions/6885436/what-is-the-difference-between-sgi-slist-and-c11-forward-list |
5,842,108 | Is there any Qt container that returns its values as comma separated string? | In Qt, does one of the containers give me the option to return a comma-separated string from its values? | Is there any Qt container that returns its values as comma separated string? In Qt, does one of the containers give me the option to return a comma-separated string from its values? | qt, containers, csv | 6 | 3,424 | 1 | https://stackoverflow.com/questions/5842108/is-there-any-qt-container-that-returns-its-values-as-comma-separated-string |
4,020,905 | Implement iteritems function for my custom iterator? | The objective of the following program is to learn python generators and iterator implementation in order to understand Python magic methods. I'm stuck implementing the iteritems() function. Also, I want to know whether I'm going on right direction or I'm conceptually wrong in understanding of python magic methods. imp... | Implement iteritems function for my custom iterator? The objective of the following program is to learn python generators and iterator implementation in order to understand Python magic methods. I'm stuck implementing the iteritems() function. Also, I want to know whether I'm going on right direction or I'm conceptuall... | python, iterator, containers | 6 | 4,569 | 1 | https://stackoverflow.com/questions/4020905/implement-iteritems-function-for-my-custom-iterator |
2,160,117 | Is it Bad Practice to use C++ only for the STL containers? | First a little background ... In what follows, I use C,C++ and Java for coding (general) algorithms, not gui's and fancy program's with interfaces, but simple command line algorithms and libraries. I started out learning about programming in Java. I got pretty good with Java and I learned to use the Java containers a l... | Is it Bad Practice to use C++ only for the STL containers? First a little background ... In what follows, I use C,C++ and Java for coding (general) algorithms, not gui's and fancy program's with interfaces, but simple command line algorithms and libraries. I started out learning about programming in Java. I got pretty ... | c++, c, containers | 6 | 1,070 | 4 | https://stackoverflow.com/questions/2160117/is-it-bad-practice-to-use-c-only-for-the-stl-containers |
1,440,287 | How to create a container of noncopyable elements | Is there a way use STL containters with non-copyable elements? something like this: class noncopyable { noncopyable(noncopyable&); const noncopyable& operator=(noncopyable&); public: noncopyable(){}; }; int main() { list<noncopyable> MyList; //error C2248: 'noncopyable::noncopyable' : cannot access private member decla... | How to create a container of noncopyable elements Is there a way use STL containters with non-copyable elements? something like this: class noncopyable { noncopyable(noncopyable&); const noncopyable& operator=(noncopyable&); public: noncopyable(){}; }; int main() { list<noncopyable> MyList; //error C2248: 'noncopyable:... | c++, stl, containers, noncopyable | 6 | 3,514 | 3 | https://stackoverflow.com/questions/1440287/how-to-create-a-container-of-noncopyable-elements |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.